Mvc
The MVC pattern means that the software can be divided into three parts
View: User interface.
Controller: Business logic
Model: Data saving
Practical projects tend to take a more flexible approach, taking backbone.js as an example.
- The user can send instructions (DOM events) to view, and the view directly requires Model to change state.
- The user can also send instructions directly to the controller (changing the URL to trigger the Hashchange event), which is then sent to the View by the controller.
- The Controller is very thin and only acts as a route, and the view is very thick and the business logic is deployed in view. Therefore, Backbone simply cancels the Controller, leaving only one Router (router).
Mvp
- The communication between the parts is bidirectional.
- View and Model do not contact, are passed through Presenter.
- The view is very thin and does not deploy any business logic, called the "Passive View" (Passive view), without any initiative, and presenter is very thick, where all the logic is deployed.
MVVM
The MVVM pattern renamed Presenter to ViewModel, which is basically exactly the same as 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
1.http://www.ruanyifeng.com/blog/2015/02/mvcmvp_mvvm.html
Mvc,mvp,mvvm