MVC idea & three-tier architecture

MVC
is an ideological program design, full name is M Odel (business model) V IEW (page views) C ontroller (Controller)

MVC Responsibilities
(1) Controller C : During the whole process, the controller not only interacts with the front-end interface, but also interacts with the back-end Java code (Model) to play a core control role.
All requests submitted by web users to the server are taken over by the controller. After receiving the request, the controller is responsible for deciding which model should be called for processing (corresponding business logic processing according to the user request, and returning the data. Finally, the controller jumps to the corresponding view and presents the data to the user) or jumps directly Turn the page;
(2) Model M : background Java code, including business code, persistence layer code, entity classes, etc.
(3) View V : page, only display content
Note: Model cannot interact directly with the view

================================================= ==========
Three-tier architecture
(1) Presentation layer (UI): In layman's terms, it is the interface presented to the user, that is, what the user sees and gains when using a system;
(2) Business logic Layer (BLL): Operation for specific problems, it can also be said to be the operation of the data layer, and the logical processing of data business;
(3) Data Access Layer (DAL): The transaction at this layer directly manipulates the database, aiming at data addition , Delete, modify, update, search, etc.;
(what I understand is the control layer + service layer + persistence layer)

================================================= ======= The
three-tier architecture is not directly related to MVC. MVC is a design pattern, while the three-tier architecture is a software architecture.
The purpose is to decouple, improve code reuse, suitable for team development.

Guess you like

Origin blog.csdn.net/ExceptionCoder/article/details/108682019