Layer-3 Structure Analysis

Source: Internet
Author: User
Layering the system to be implemented is not an idea created after the emergence of object-oriented systems. Before that, layering has been widely used. For example, the TCP/IP protocol is implemented by layering. Layering has the following features:
I. division of functions. Each layer should have its own basic functions different from those of other layers.
2. Isolation and stability. The structure of the layer and the layer should be relatively independent and isolated from each other, so that changes in the content or structure of a layer have little impact on other layers, the functions and structure of each layer are relatively stable.
Iii. Branch expansion: the public part and the available part are divided into different layers, which facilitates flexible expansion of the branch part and the relative stability of the public part, reducing the duplication of the structure.
4. The relationship between the bottom layer and the upper layer is the relationship between the service provider and the customer.
From the above, we can see that the encapsulation and Inheritance of object-oriented technology has a greater advantage in implementing the layered thinking.

The three-tier structure of the system is the user interface layer, business logic layer, and data layer (also hasArticleI think it is a database layer, but I think it is not appropriate to call it a database layer. The following will be an analysis ).
User Interface Layer: responsible for processing user input and output to the user, but not explaining the meaning (for efficiency considerations, it may perform legality verification before transmitting user input to the business logic layer ).
Business logic layer (also called business logic layer): receives user requests from the user interface layer, convert it into the startup conditions required by the business process, send data requests to the data layer in an orderly manner according to the business logic, and interpret and combine the data returned by the data layer into the user's required information, return to the user interface layer.
Data Layer: manages data and provides standardized open access interfaces to the business logic layer. It provides the following functions: data creation, data storage, data query, data update, data deletion, data security, transaction support, and data backup/recovery. We can see that, if we simply understand it as a database layer, we ignore the XML document. More importantly, we cannot reflect the requirements for the data layer to provide access interfaces.
Consider a bank's accounting system. The user interface layer of the system includes the terminal of the bank counter, the ATM machine, and the browser of the online bank. If stratified technology is not used, so what is the situation?

If you want to use an object-oriented method to implement a three-tier structure, there are a lot of technologies involved, such as OOA/OOD, UML, and up.

The implementation of the system in a layered manner is much more labor-intensive than the implementation without a hierarchical approach, and the development cycle is longer (because moreCode), Why? I think the main reason is that Tiering is more flexible, easy to maintain, and reusable-when you finish writing the first Tiering system and make the second one, we will find that there are many things that can be reused-these are important standards for measuring the quality of software.

For the data layer, ado.net has provided us with a variety of features, while "Microsoft application blocks for. Net" (http://www.microsoft.com/china/msdn/archives/library/dnbda/html/daab-rm.asp) is also a good choice.
The business logic layer is the focus of our efforts. We need to encapsulate all business rules at this layer.

I used to think that layering is to make the layers into modules such as DLL. However, this obfuscated the separation and layering-they still have a lot in common: they all simplify complicated problems, all functions are modularized. However, the Division emphasizes separating the organic whole into smaller units, which is a vertical division; stratified division emphasizes dividing an organic whole into independent units with relationships between customers and service providers, which is a horizontal division.

Another important layer is the network access layer. This layer is not obvious in projects of the web service class (the browser and IIS handle this layer), but when winform is used as the user interface layer to access the business rule layer, or Heterogeneous System Interconnection (UNIX, Linux, Windows), this is a layer that must be taken seriously.

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.