11.18(eleven point one eight)








3、增加了开发成本。三层架构是一种软件架构(software architecture) ,是一种分层结构。在软件体系架构设计中,分层式结构是最常见,也是最重要的一种结构,它将整个业务应用从上到下划分为:表示层(User Interface layer)、业务逻辑层(Business Logic Layer)、数据访问层(Data access layer)。三层结构的出现的目的是为了解决B/S应用的高内聚低耦合。





Principle and function of three-tier architecture_ How to use the three-tier architecture —- advantages 1. Developers can only focus on one layer of the whole structure;

2. You can easily replace the original level of implementation with a new implementation;

3. It can reduce the dependence between layers;

4. Conducive to standardization;

5. It is conducive to the reuse of logic in each layer.

Principle and function of three-tier architecture_ How to use the three-tier architecture —- disadvantages 1. It reduces the performance of the system. If the hierarchical structure is not adopted, many businesses can directly visit the database to obtain the corresponding data, but now they must be completed through the middle tier.

2. Sometimes it leads to cascading modifications. This change is particularly reflected in the top-down direction. If a function needs to be added in the presentation layer, in order to ensure that its design conforms to the hierarchical structure, it may be necessary to add corresponding code in the corresponding business logic layer and data access layer.

3. Increased development costs. The three-tier architecture is a software architecture and a hierarchical structure. In software architecture design, hierarchical structure is the most common and important structure. It divides the whole business application from top to bottom into user interface layer, business logic layer and data access layer. The purpose of three-layer structure is to solve the high cohesion and low coupling of B / s applications.

Presentation layer: also known as presentation layer UI, it is located at the top of the three-tier architecture and has direct contact with users, mainly web browsing pages in B / s information system. The main function is to realize the input and output of system data, transfer the data to the business logic layer for data processing, and the business logic layer will feed back the processing results to the presentation layer after processing.

Business logic layer: located in the middle of the presentation layer and the data layer, it is the bridge between the presentation layer and the data layer. First, the received data is logically processed, and then the data access layer is called to realize the functions of data modification, acquisition and deletion, and the processing results are fed back to the presentation layer.

Data access layer: it mainly operates the database, realizes the operations of data addition, deletion, modification and query, and feeds back the operation results to the business logic layer, specifically providing data services for the business logic layer or presentation layer.