1, the early web system is not designed using layered thinking, a lot of code will appear in a servlet or JSP, which inevitably lead to poor code quality.
2. Mvc layering mode
The MVC layering pattern refers to the abbreviation of model, view, control (Controller), and the use of layered mode can not only improve the quality of the code, but also have great benefit to the later maintenance.
The MVC layering pattern is mainly used to realize the functional division of the web system.
In the MVC design structure:
The model layer mainly implements the business logic in the system, which can usually be implemented by JavaBean or EJB;
View layer is mainly used to interact with the user, mainly using JSP implementation;
The Cotroller layer is a bridge between the model layer and the view layer, which is usually implemented using a servlet;
3. What is a three-tier architecture?
The usual three-tier architecture refers to dividing the entire business application into three tiers: the presentation layer (UI), the Business Logic layer (BLL), the data Access layer (DAL);
The purpose of three-layer architecture: cohesion, low coupling;
Presentation Layer (UI): Popular speaking, is what the user can see on the page;
Business Logic Layer (BLL): According to the operation of the specific problem, the data is processed by business and logic;
Data access Layer (DAL): Also known as the persistent layer, is to access the database, to achieve additions and deletions to change the data operation.
Java Web: Layered design