1. What is a three-tier architecture? 1. Concepts
A three-tier architecture generally divides the entire business application into a presentation layer (UI) and a business logic layer (BLL) data access layer (DAL ). The purpose of hierarchy differentiation is the idea of "high cohesion and low coupling.
Tier) |
Concept |
Presentation layer (UI) |
In layman's terms, the interface is displayed to the user, used to display data and receive user input data, that is, what the user sees when using a system. |
Business logic layer (BLL) |
Operations for specific problems can also be called operations on the data layer and data business logic. It is a bridge between the presentation layer and the data access layer. |
Data access layer (DAL) |
Transactions made at this layer directly operate on the database, and add, delete, modify, and search data. |
Database entity) |
Encapsulates Data Objects and provides some simple functions. |
Role of each layer
Tier) |
Concept |
Presentation layer (UI) |
It mainly indicates the Web mode or winform mode, and the Web mode can also be represented as Aspx. If the logic layer is quite powerful and complete, no matter how the presentation layer is defined or changed, the logic layer provides complete services. |
Business logic layer (BLL) |
The operation is mainly for specific problems. It can also be understood as a pair of operations on the data layer. For data service logic processing, if the data layer is a building block, the logic layer is the construction of these building blocks.
|
Data access layer (DAL) |
The operation layer mainly refers to the operation layer of raw data (the form of storing data such as databases or text files), rather than the raw data, that is, the operation of data, rather than the database, provides data services for the business logic layer or presentation layer.
|
From the table above, we can see that the entity of a database does not exist as a layer in the Layer 3, but as a class library to encapsulate database tables.
2. connections between layers and Class Libraries
It is represented by a graph:
Next article: why should we use a three-tier architecture?