In fact, I have always been, although do the front-end work, but there is a question, is what is the MVC pattern, although probably know, but specifically do not say, today, I would like to summarize the MVC, MVP,MVVM pattern difference and the same.
1.MVC mode:
The MVC pattern means: M (model) V (View) C (Controller)
Model: Data Preservation
Views View: User interface
Controller: Business logic
In summary, this is: User interface (view) ==> Controller * Input content/Click Change through business logic, return content to ==> model data by saving ==> return to user interface (view) feedback to the user
or (the general process of MVC can be this: the View (interface) triggers the event-"the Controller (business) handles the business and then triggers the data update-" does not know who updated the model data-"model (with the data) back to the view--" View Update data)
2.MVP mode:
MVP mode means: M (model) V (View) P (Presenter)
Model: Data Preservation
Views View: User interface
Presenter: Equivalent (Controller in MVC)
User interface (View) enables bidirectional access <==> controller (Presenter) to change data through changes in business logic <==> Data Preservation (Model)
3.MVVM mode: M (model) V (View) VM (ViewModel)
Model: Data Preservation
Views View: User interface
Controller (ViewModel): Change business logic
Identical to the MVP model, the only difference is that it uses two-way binding (data-binding): The change of view is automatically reflected in ViewModel, and vice versa. This pattern is used in both Angular and Ember.
Reference Link: http://www.ruanyifeng.com/blog/2015/02/mvcmvp_mvvm.html
The difference between MVC,MVP and MVVM