Within Exrin, using the normal hierarchy of ViewModel
having access to the IModel
, The Model
having access to the IService
, and Operation
s commonly having access to the IModel
yet being called from the ViewModel
, what is the proper use of methods and interactions within each scope?
For example, I need to clear a table in my SQLite database on navigating to a page. I have an IRepositoryService
that contains all my methods for interacting with our database. My Model
has a ClearUserInputTables
method that calls a few different methods within the IRepositoryService
.
I could either override the OnAppearing
method (may likely change it to a different point in the life cycle) within the ViewModel
to call the Model.ClearUserInputTables
method or I could create an Operation
that has access to the Model
to do the same thing. Which is favored in Exrin?
Maybe I need a better understanding of the purpose of Operation
s. I read up on Operation Separation (basically used for navigation), but am unsure if it should be used for other things such as this (calling Model
methods from the ViewModel
).