-
Notifications
You must be signed in to change notification settings - Fork 198
A brief description of the MVVM Model
The MVVM Model forces the separation of the business logic from the user interface. This provides you with a huge array of benefits, the main one being that it allows you to truly think from a user's perspective and for that reason it can be viewed as a user centric model.
Not all architecture methods allow this and as a designer/developer/architect you are constantly juggling between the user interface and business logic. Let’s be honest, they are both equally important. If one if terrible it lets the other one down resulting in your hard work not seeming so great any more, overshadowed by poor quality or the sense of some part of the application being ‘forgotten’.
Users find it difficult to look past a poorly designed interface, especially if it means the awesome functionality you have spent so much time on is so hard to use from their point of view. The user experience will begin negatively which is something to avoid at all costs. The other side is that an excellent UI with no or little functionality is practically useless and quickly discarded.
MVVM allows you to abstract and focus on them in their individual parts as separate entities to deliver software that looks and functions just the way you want it without compromising on either. The result? The business logic and the UI can be good at their own thing and only interact with each other when required.
View – What the user sees, the UI, it also can hold events. It is bound to a View Model through data binding.
ViewModel – Can have states & detect changes. It is a data representation of the actual raw data in the model. It is not the UI (View) it is not the data (Model), it is the ‘In Between’ link. It describes the data, similar to how a map describes the location of a city, but doesn't explicitly say where that city is or what specifically it is (small city, big city, city with 1 cathedral etc.), because the user doesn't have to know, only the View Model does so it can write back changes to the Model if required..
Model – The Model is the stored raw data, it gives the View Model the data so it can manipulate it but it’s not the actual data so the logic is performed in the View Model first before anything committal to the data comes this way.