What is a three-tier architecture?
Let's talk about the three-tier structure in the hotel.
Waiter: hospitality/submit menu
Chef: raw materials, cooking, and food delivery
Purchasers: Procurement
Layer-3 Structure Analysis
(1) The presentation layer provides users with an interactive operation interface.
(2) the business logic layer is responsible for key business processing and data transmission with the presentation layer and data access layer.
(3) data access layer stores and reads data.
The relationship between layers in a three-tier structure ----- the high-level dependency on the lower layer
Data transmission relationships between layers in a three-tier structure --- high-level request and low-level response
Three-layer structure construction method
1. Build a presentation layer (create a Windows Application)
2. Build a business logic layer (Class Library)
3. Build a data access layer (Class Library)
4. Add dependencies between layers
Use of entity classes in a three-tier structure
An entity class is a class that describes a business entity, namely:
Define each field in a data table as an attribute and encapsulate these attributes in a class. This class is called an object class.
Use of entity classes in a three-tier structure
Business entities can be considered to belong to the business logic layer. If you divide the layers into more details, you can separate the business entities as a layer called the business entity layer.
The presentation layer, business logic layer, and data access layer depend on business entities. Data transmission between layers is mainly an object.
You can use data as objects by using object classes.