What's the difference between MVC and MVVM?

Source: Internet
Author: User

In MVC, view is directly accessible to the model! As a result, the view contains the model information and inevitably includes some business logic. The MVC model is concerned with the constant model, so in the MVC model, models do not depend on the view, but the view is dependent on model. Not only that, because some business logic is implemented in view, it is difficult to change the view, at least those business logic is not reusable.

MVVM is conceptually a pattern that actually separates the page from the data logic, it puts the data binding work into a JS, and the main function of this JS file is to complete the data binding, that is, to bind the model to the elements of the UI.

Someone has tested: using angular (MVVM) instead of backbone (MVC) to develop, the code can be cut in half.

In addition, MVVM is another important feature of two-way binding. It makes it easier for you to maintain the n areas of a field on a page at the same time without having to update them manually.

What's the difference between MVC 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.