MVVM Interview Questions and Answers Part -2
Differentiate between MVVM, MVP and MVC?
The difference is in way how data from model layer ends up in the view instances.
- In classical MVC (and also in Model2 MVC) view is active structure. It requests information from model layer. Controller only changes the state of model layer and view.
- In MVP the view is passive. Instead presenter request information from model layer and passes it the view.
- In MVVM is similar to MVP, but the viewmodel has to manipulate the information before passing it to view.
The difference between MVP and MVVM is in the development process. You would use MVP pattern, when creating presentation layer for a known model layer.
But you will have to use MVVM, if you have a preexisting (or for some reason – un changeable) user interface and preexisting (or unchangeable) model layer. And you have to make them work together. That’s where viewmodel comes into play.
This is explained in more details Here :