L3 architecture and its advantages and disadvantages

Source: Internet
Author: User

The three-tier architecture (3-tier Application) generally divides the entire business application into: presentation layer (UI) and business logic layer (BLL) data access layer (DAL ). The purpose of hierarchy differentiation is the idea of "high cohesion and low coupling.
1. Presentation layer (UI): The interface displayed to the user, that is, what the user sees when using a system.
2. Business logic layer (BLL): operations for specific problems can also be said to be operations on the data layer and data business logic processing.
3. Data access layer (DAL): transactions made at this layer directly operate on the database and add, delete, modify, update, and search data.
Note: cohesion: the closeness of each element in a module. Coupling: The measurement of the degree of interconnection between different modules in a software structure)

Advantages and disadvantages
Advantages:
1. developers can only pay attention to one of the layers in the entire structure;
2. It is easy to replace the original implementation with the new implementation;
3. The dependency between layers can be reduced;
4. conducive to standardization;
5. facilitate the reuse of logic at each layer.
6. Strong scalability. Different layers are responsible for different layers. For example, petshop can convert between sqlserver and Oracle through simple configuration. Of course, if it is completed, it can also convert between B/S and C/S.
7. High security. The user can only access the data layer through the logic layer, reducing entry points and shielding many dangerous system functions.
8. The project structure is clearer and the division of labor is clearer, which is conducive to later maintenance and upgrade.
Disadvantages:
1. Reduced system performance. This is self-evident. If the hierarchical structure is not used, many businesses can directly access the database to obtain the corresponding data, but now it must be done through the middle layer.
2. Cascade modifications may sometimes occur. This kind of modification is especially reflected in the top-down direction. If you need to add a function in the presentation layer, to ensure its design conforms to the hierarchical structure, you may need to add the corresponding code in the corresponding business logic layer and data access layer.
3. added the amount of code and workload.

The three-tier architecture is:

I. Interface Layer
The interface layer provides a visual interface for users to input data and obtain data through the interface layer. The interface layer also provides a certain degree of security to ensure that users do not need to see unnecessary confidential information.

Ii. logic layer

The logic layer is a bridge between the interface layer and the data layer. It responds to user requests at the interface layer, executes tasks, captures data from the data layer, and transmits necessary data to the interface layer.

Iii. Data Layer
The data layer defines and maintains data integrity and security. It responds to requests at the logic layer and accesses data. This layer is usually implemented by large database servers, such as Oracle, Sybase, and ms SQL Server.

------

From the perspective of development and application, the three-tier architecture has a greater advantage than the double or single-tier architecture. The three-layer structure is suitable for group development. Each person can have a different division of labor. collaborative work doubles the efficiency. When developing a double-or single-layer application, each developer should have a deep understanding of the system and have high requirements on capabilities. When developing a three-layer application, you can combine multiple talents, only a few people have a full understanding of the system, which reduces the difficulty of development to a certain extent.
The three-tier architecture is a thin customer model. Users only need a smaller hard disk, smaller memory, and slower CPU to achieve good performance. In contrast, the requirements for Single-layer or fat clients are too high.
Another advantage of the three-tier architecture is that it can better support the distributed computing environment. Applications on the logic layer can run on multiple machines, making full use of the computing functions of the network. Distributed Computing has a huge potential, far more effective than upgrading the CPU.
The biggest advantage of a three-tier architecture is its security. The user can only access the data layer through the logic layer, reducing entry points and shielding many dangerous system functions.
In addition, the three-tier architecture also supports the following features: Remote Access (Remote Data Access), for example, remote database access through the Internet; High Performance (improved computing efficiency) solves the centralized computing (centralize) in the master-slave architecture (client-server), the computing workload of the Database Host reduces the connection load of the Database Host, and the application server can process a large number of data processing requirements by increasing the number of data processing requirements, this is a truth from the distributed computing mentioned earlier. After the client sends a request (work requirement), it can go offline and submit it to the app server and database server to complete the work, reduce the waiting time on the client side. I think there are not many application scenarios, and I am not very impressed with this function. It is theoretically true.

For small projects, there will be no need for a three-tier architecture.

ASP. NET three-layer structure description

The perfect three-tier structure requires that you modify the presentation layer instead of the logic layer, instead of the data layer. Otherwise, it is hard to say whether your application has a multi-layer structure, or whether there is a problem with the Division and organization of the layer structure. Different applications have different understandings. This is just a conceptual question.

Understanding ASP. NET's three-tier structure-why is it divided into three layers?

We use a three-tier structure to make the project structure clearer and the division of labor clearer, which is conducive to later maintenance and upgrade. It may not improve the performance, because when the subprogram module is not executed, the main program module can only be in the waiting state. This shows that dividing an application into layers will cause some loss in its execution speed. However, from the perspective of team development efficiency, we can feel a big difference.

It should be noted that the layer-3 structure is neither a. Net patent nor a technology dedicated to databases. It is a more universal architecture design concept.

In this architecture, we need to pay attention to the relationship between tables in the database design, and try our best to satisfy the relationship between the master and the child. Users must have certain functional limitations. do not exercise caution when deleting sub-tables, in this case, the foreign keys of the primary table that are logically present in the data of the primary table and the sub-table do not have the corresponding values in the sub-table.

The following table query methods are used:

First, query the master table and call the DL corresponding to the master table. Query each sub-table based on the records of the master table. A large query set is formed after the query result of the Self-table is added to the master table.

Operations on tables (add, delete, and modify ):

In this case, only the primary table is operated and the operation method in the DL corresponding to the primary table is called.

The RL layer is the logical judgment layer, mainly used to perform logical judgment on the data uploaded to the page. Above the RL layer is the UI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.