We adopt the three-tier structure mainly to make the project structure clearer and the division of labor clearer, which is conducive to the later maintenance and upgrading. Performance may not be improved because the main program module can only be in a waiting state when the subroutine module is not executed. It can be seen that layering the application will bring some losses to its execution speed. But from the perspective of team development efficiency, we can feel completely different effects.
It should be noted that the three-layer structure is not a patent. NET, nor is it a technology specially used for databases. It is a more general architectural design concept.
The UI layer is an interface that interacts with users. Users send requests to the BLL layer through the UI layer, and then the BLL layer sends requests to the DAL layer. DAL link database takes out the required data and returns it to the business logic layer. The BLL layer processes the data accordingly and presents it to the user on the interface.
In practical application, it will be subdivided according to the specific situation, so that you have a multi-layer structure. Although there are many layers, they are not separated from the three-layer structure, but only subdivided.
DALFactory generally uses the reflection principle to obtain a specific instance of DBUtility. It is used to handle database changes.
The essence of the three-tier architecture is one sentence: sacrifice efficiency for flexibility!
Just like I want to produce a car, I just need to define an overall structure, for example, I make four wheels and a steering wheel ... As for the wheels and steering wheel, I make a function that I should have (this is the function of the interface), such as friction coefficient, for other manufacturers to do. I don't care how he did it, or what other manufacturers did. Just give me the wheels that meet my standards.