Why use layer three.
The purpose of layering is to "high cohesion, low coupling" thinking.
Cohesion is the degree to which each element in a module is tightly bound to each other, and high cohesion is a module in which each element is tightly bound to each other. In other words, the so-called high cohesion refers to a software module that is made up of highly relevant code that is responsible for only one task, which is often referred to as a single principle of responsibility.
Coupling, or inter-block linkage, refers to a measure of the degree of interconnection between modules in a software structure. The tighter the connection between the modules, the stronger the coupling, the less the module's independence, the higher the coupling between modules depends on the complexity of the interface between the modules, the way the calls are made, and the information that is transmitted, for low coupling in other words a complete system, between modules and modules, as much as possible to make it stand alone As much as possible to complete a specific sub-function, the module and the interface between the module, as little as possible and simple.
The benefits of cohesion are reflected in the continuous development of the system, cohesion, low-coupling systems with better reusability, maintainability, scalability, can more efficiently complete the maintenance and development of the system, continue to support the development of the business, and will not become a barrier to business development.
What is layer three.
The three-tier architecture typically has a three-tier architecture that divides the entire business application into: The presentation layer (UI), the Business Logic layer (BLL), the data Access Layer (DAL).
Presentation Layer
Popular speaking is the interface that is presented to the user, that is, what the user sees when he or she uses a system. At the outermost (topmost), closest to the user. The user's request to receive, as well as the return of the data, to provide the client with application-level access, or to display data and receive user input data, to provide users with an interactive interface.
Business Logic Layer
The main functions and business logic of the system are processed in the business logic layer. is the core value of the system architecture, focus on the development of business rules, business process implementation, data access, legal verification and other business requirements related to the system design.
The specific content includes the work to do some effective verification, in order to better ensure the robustness of the program running. such as the completion of data addition, modification and query business, and so on; Do not allow the specified text box to enter an empty string, the data format is correct and data type validation, the legality of user rights judgment, etc. through the above many judgments to absolutely whether the operation continues to pass backward, as far as possible to ensure that the normal operation of the program.
The business logic layer, in addition to the operation of the data layer, also includes the operation of the data layer, processing the data business logic. It can be said that the business logic layer plays two different roles, for the data access layer, it is the caller, and for the presentation layer, it is the callee.
Data layer
Mainly to the original data (database or text files, such as the form of data storage), rather than the original data, that is, the operation of the data, rather than the database, specifically for the business logic layer or presentation layer to provide data services, simply said to achieve the data table of the increase, delete, change, check and other operations.