Play Spring MVC (II)----MVC Framework

Source: Internet
Author: User

Early programmers did not have a specification when writing code, the system's business logic and database access when mixed together, not only added a lot of repetitive work, but also increased the difficulty of later maintenance.

Later, it was gradually discovered that some common functions could be encapsulated separately, thus reducing the amount of code.

And then, gradually, athree-tier architecture model, that is, the presentation layer, the business logic layer, the data layer. The presentation layer is the interface of the system, and the control system shows some things to the user; The data layer mainly realizes the interaction with the database, such as data deletion and modification; the business logic layer is in the middle of data access layer and presentation layer, which plays the role of connecting link in data exchange, mainly used for processing data. By layering, the coupling between functional layers is weakened, which facilitates the later maintenance of the code.

However, even so, people still feel that the coupling between the code is too large, the expression layer and the business logic layer is too close, so between the presentation layer and the business logic layer to add a layer of control layer, by judging the performance layer from the request (that is, the user's request) to decide which business processing logic to invoke. This gradually evolved the MVC framework.

MVC,That is, the model---view---controller, although MVC is also three layers, but not corresponding to the three-tier schema model one by one. A typical MVC framework is jsp+servlet+javabean,jsp, which is a view, a Servlet is a controller, and a JavaBean is a model. In practical application, we will further refine the model layer, which can be divided into business processing layer and data access layer.

The three-tier architecture model focuses on the overalldecoupling, that is to achieve "cohesion Poly, low couplingAnd the MVC framework focuses on decoupling the web system, which focuses on the decoupling of JSP and servlet implementations.

In the case of spring MVC alone, it implements the connection between View,controller,model through an XML file, which further reduces the coupling between the code through dependency injection.

Play Spring MVC (II)----MVC Framework

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.