What is a three-tier architecture?
Let's talk about the three-storey structure in the hotel.
Waiter: Hospitality/Submit Menu
Chef: Material/stir-fry/cross-dish
Buyer: Purchasing
Three-layer structural analysis
(1) The presentation layer provides the user with an interactive interface.
(2) The business Logic layer is responsible for the processing of the critical business, which is responsible for the data transmission with the presentation layer and the data access layer.
(3) The data access layer realizes the saving and reading operation to the data.
The relationship between the layers of three-layer structure-----High-level dependence on the lower layer
Data transfer relationship between layers of three-layer structure---high-level requests low-level, low-rise response
Three-storey structure building method
1. Build the presentation layer (create a Windows application)
2. Building the business Logic layer (class library)
3. Building the data Access layer (class library)
4. Adding interdependencies between layers
Use of entity classes in three-tier structures
An entity class is a class that describes a business entity, namely:
Each field in a data table is defined as a property, and these properties are encapsulated in a class, which is called an entity class.
Use of entity classes in three-tier structures
Business entities can be considered to belong to the business logic layer. If you divide the hierarchy into finer points, you can separate the business entities as a layer of business entities.
The presentation layer, the business logic layer, and the data access layer all depend on the business entity. The transfer of data between layers is primarily an entity object.
By using an entity class, you can use the data as an object.