The difference between MVC,MVP and MVVM

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.