The diary written when I first learned the MVC pattern N years ago

Source: Internet
Author: User

MVC is an abbreviation of three letters:

Modol Mode

Controller

View

The traditional MVC view is a Web page that displays various content.

The controller is a traditional dynamic interaction between CGI, PHP, or ASP. NET and servers.

The MVC data stream is integrated into the view to display the response data based on interaction.

Use MVC in Ajax to design webpages:

Benefits: division of labor is the mainstream in the future.

Artists engage in artists, programming, and so on.

View in Ajax: provides a visual interface to Monitor Interface operations

Interact with the Controller to display the required data

View Example: for example, a web page: design the display style of a Web page, what is displayed on the web page, and what controls are available,

As for business logic, no need to understand, no need to design, only design the appearance of the web page, so no other knowledge,

You only need to design webpages, and use CSS to design styles.

Do not include the logical part in the View:
Although the above use is correct, it does not comply with MVC, because it will bring confusion to the artist. The correct method is: a good artist is a genius. Sometimes I want artist Picasso.
The appearance of a webpage can play a decisive role, so it is necessary for the artist to be professional (or not very good, the artist must know
What does onclike mean? This will reduce the professionalism of the artist, but this method is acceptable to the artist)Then, design such a function in the business logic layer.
ABC (event) {showresult ("data. xml", "name ");}
The artist can use only one function name, but does not need to know anything else. They only need to know that this is a click event. A good artist should focus on using existing parts.
Create a beautiful Web interface without worrying too much about it. The more professional the artist works, the more helpful the design.

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.