MVC programming mode and its variants, mvc programming variants

Source: Internet
Author: User

MVC programming mode and its variants, mvc programming variants
MVC programming mode and its variants

The full name of MVC is Model View Controller, short for model-view-controller. It is a common programming Model. MVC was first proposed to separate the data from the view, and then use the Controller as glue to bond the relationship between the data and the object. this is the design concept of separation of concerns, and also the Single-Resposibility Principle ).

In our development process, the view is used to display the interface. Our model processes the business and holds data, while the controller is the intermediary between them.

The four-person GoF Group considers MVC as "a set of classes used to build user interfaces. It is the evolution of the other three classic design patterns: Observer mode, policy mode, and combination mode ". the specific implementation may also use the factory mode, decorator mode, bridge mode, and intermediary mode.

The following describes MVC and its variants.

VC mode (view --> controller)

This mode is used in a simple interface, where the amount of code is small. Generally, the Business Code is in the controller.

VMC mode (view --> model --> controller)

In this mode, the first object transmitted by the view is the model. If the model can be processed, the controller is not notified at all, which can reduce the amount of controller code.

VCM mode (view --> controller --> model)

This is our most common mvc model.

In fact, the ultimate goal is to clarify the boundaries so that multiple people can work in parallel.

Related Article

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.