This blog is a general summary of the three-layer model, specifically about what is a three-storey structure, why there are three-layer structure, three-layer structure of the three layers, three-layer structure of the application scenario and the use of three-layer structure of the advantages and disadvantages.
What is a three-layer structure?
The three-tier structure we are discussing is logically divided into three layers, and the three-tier structure is actually dividing the entire business application into three layers.
Why should there be a three-storey structure?
The purpose of dividing three levels is to achieve "high cohesion and low coupling".
Classification of three-layer structures.
According to the hierarchical structure recommended by Microsoft, from top to bottom are: data access layer, business logic layer, presentation layer.
Three-layer structure of the application scenario.
Complex business logic, both the data access layer, and the business logic layer, only need to use three-tier structure. A three-tier architecture is not required for simple business logic, or without a real data storage layer.
The pros and cons of using a three-tier architecture.
Advantages:
1. A developer can focus on only one of the layers in the entire structure
2, can easily use the new implementation to replace the original level of implementation
3. Can reduce the dependence between layer and layer
4, in favor of standardization
5. Facilitate the reuse of all logic
Disadvantages:
1, reduce the performance of the system, if not adopt a layered structure, many businesses can directly visit the database to obtain the corresponding data, but now must be done through the middle tier
2, sometimes cause cascade modification (cascade is the parent change children also change). This change is also reflected in the top-down direction, if you need to add a function in the presentation layer, in order to ensure that the design conforms to the layered structure, you may need to add the corresponding code in the corresponding business logic layer and the data access layer.
Now understand is relatively shallow, slowly will be through to practice to experience, there are specific three levels is what to do please look at the following, if you feel good on the manual point of Praise ....