Three-layer frame:
The typical three-tier architecture is to divide the entire business application into: The presentation layer (UI), the Business Logic layer (BLL),
The data Access layer (DAL). The purpose of distinguishing hierarchy is to "high cohesion, low coupling" thought.
Principle:
1: The data access layer: mainly for the original data (database or text files, such as the form of data storage) operation layer, rather than the original data, that is to say,
Is the operation of the data, not the database, which provides data services for the business logic layer or presentation layer.
2: Business logic Layer: mainly for the specific problem of operation, can also be understood as the operation of the data layer, the data business logic processing, if the data layer is a product
Wood, the logical layer is the building of these blocks.
3: The presentation layer: mainly represents the user's operating terminal, if the logical layer is quite powerful and perfect, no matter how the presentation layer is defined and changed, the logical layer can be fully provided
Service.
Specific methods of differentiation
1: Data access layer: The main view of your data layer contains no logical processing, in fact, his various functions mainly to complete the operation of the data files. And not
Other operations must be managed.
2: Business Logic Layer: mainly responsible for the operation of the data layer. In other words, the operation of some data layers is combined.
3: Presentation layer: The primary request is accepted by the user, and the data is returned, providing the client with access to the application. On the outermost (topmost), closest to the user.
Used to display data and receive user input data, to provide users with an interactive interface.
Advantages and Disadvantages
Advantages
1, the developer can only focus on the entire structure of one of the layers;
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 the logic of each layer.
6, the structure more clear
7, in the late maintenance, greatly reduced maintenance costs and maintenance time
Disadvantages
1, reduce the performance of the system. This is self-evident. Without a tiered structure, many businesses can access the database directly to obtain the appropriate data,
Now it has to be done through the middle tier.
2. Sometimes cascade changes are caused. This kind of modification is especially reflected in the top-down direction. If you need to add a feature in the presentation layer, to ensure that its design conforms to the
Layered structure, you may need to add code to the appropriate business logic layer and the data access layer.
3, increase the development cost.
JDBC Three layer architecture