Separation of concerns — How to separate presentation from data and logic?
- Model: domain-specific data, does not matter how it is interacted with
- View: visual representation of current state of model
- Controller: moderates user interactions, makes business decisions
MVC
- Low level controller/model code can be easily shared
- View can have direct access to model and thus can communicate with model directly
- Model updates view directly
MVVM
- Easier to develop in parallel (V only talks to VM)
- View does not communicate with model directly
- View has no idea what are in model and just needs data binding
- Model does not concern with formatting
- ViewModel is similar to MVC but only does data translation and formatting between Model and View
- (more directly maps to MyVeryCool Drink Factory than MVC does)