MVC (i) Basic cognition of-MVC

Source: Internet
Author: User

MVC is a programming pattern and design idea, MVC roughly cut into three main units: Model(Entity model), view (view), Contrller (Controller), MVC mainly aims at simplifying the complexity of software development, let the program code form a Loose coupling .

related to each other the first time the user accesses the browser, the URL address in the Address bar accesses the action [action] in the Contrller, and the controller decides which view to display

Model: Defines the Information Format page information validation (in fact, is the data table).

View: Presents to the user's interface, displays the background to the foreground transmits the data, passes the user input data to the backstage controller processing.

Controller: In response to customer requests, specify the data to be displayed, coordinate model to upload data values to view, for various logic processing.

MVC has an important concept of ' separation of concerns ': it is not disturbed by other objects in the same system, but also includes modifications made to objects that do not affect the operation of other objects. Pros: Simplify complexity and improve serviceability to make testing easier.

MVC is a development configuration framework that uses custom substitution configurations rationally.

Using MVC to develop project recommendations

1. Reduce code redundancy and avoid writing duplicate code

2. In the project development is to build the project structure, there is no perfect structure, suitable for this development is the best.

3. Write code to divergent thinking, not only to write and how to write more convenient, more compatible, you can give the code behind the laying of the groundwork.

4. Clear division of labor, not only teamwork to division of labor, code module also division of labor, to ensure that the code is not cluttered.

5. For the same function to reduce the complexity of the code to improve readability, team development is easier.

6. Abstraction of components to reduce coupling between components (reduce dependency on individual components)

PS: A little piece of cake please advise

 

MVC (i) Basic cognition of-MVC

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.