What is MVC?

Source: Internet
Author: User

What is MVC
MVC is a design pattern that divides an application into 3 parts: data (model), Presentation layer (view), and
User interaction Layer (Controller). In other words, the occurrence of an event is such a process:
1. Interact with users and apps.
2. The controller's event handler is triggered.
3. The controller requests data from the model and gives it to the view.
4. The view renders the data to the user.

Now look at a real example, figure 1 shows how to send a new chat message in Holla.

1. The user submits a new chat message.
2. The controller's event handler is triggered.
3. The controller creates a new chat model record.
4. The controller then updates the view.
5. The user sees a new chat message in the Chat window.
We can implement this MVC schema pattern without a class library or framework. The key is to have each part of MVC follow
Responsibilities, dividing the code clearly into sections and maintaining good decoupling. This makes it possible for each department
Independently developed, tested and maintained separately.

What is MVC?

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.