Difference between MVC, MVP and MVVM

MVC: Traditional MVC is where there is a Model: Acts as the model for data View : Deals with the view to the user which can be the UI Controller: Controls the interaction between Model and View, where view calls the controller to update model. View can call multiple controllers if needed. 

MVP: Similar to traditional MVC but Controller is replaced by Presenter. But the Presenter, unlike Controller is responsible for changing the view as well. The view usually does not call the presenter.

MVVM The difference here is the presence of View Model. It is kind of an implementation of Observer Design Pattern, where changes in the model are represented in the view as well, by the VM. Eg: If a slider is changed, not only the model is updated but the data which may be a text, that is displayed in the view is updated as well. So there is a two-way data binding.

Comments

Popular posts from this blog

Java 8 : Find the number starts with 1 from a list of integers

Junit Mockito and Power Mockito

Important Linux Commands