C # Three-tier architecture,

Source: Internet
Author: User

C # Three-tier architecture,
3-layer architecture in C #

----December

 

  • Presentation Layer
  • Business logic layer (BLL)
  • Data access layer (DAL)

Association:Produce dependency

Description:The layer-3 architecture adds an intermediate layer between the client and the database. Normally, the client cannot directly interact with the database, but interacts with the data layer through the middle layer.

[Presentation layer]

It is mainly responsible for completing user-system interaction.

It receives user input information and expresses the processing result sent by the superior to the user. Cap layer is sometimes compatible with a small part of the business logic layer (verify the data entered by the user and its legitimacy)

Generally used as a Windows or Web Application

Business logic layer]

Receives data from the presentation layer, transmits the data to the data access layer in the form of parameters, receives the processed data from the data layer, and sends the data to the presentation layer.

The work done at this layer is complex, such as business flow and data validation.

It is a bridge between the presentation layer and the data layer. You must use the business logic layer to send and receive information data.

[Data access layer]

The data access layer provides a standard and unified data access portal for the system, ensuring that the business logic layer standardizes and efficiently accesses the system data access layer, so that data can be accessed efficiently and securely.

This layer processes and interacts with databases based on the request of the business logic layer, and does not process data in any business.

[My Opinion]

The presentation layer accepts users' requests and notifies the business logic layer based on users' requests. The business logic layer first reviews the requests, then, send the request to the data access layer or directly return to the presentation layer. After receiving the request, the data access layer starts to access the database. The data access layer obtains the request result through the database access, the business logic layer is notified of the results. When the business logic layer receives the request results, the request results are notified to the presentation layer. The presentation layer receives the request results and then displays the results to users;

Ps: the user logs on to the system as an instance of this application.

User input account password ----> presentation layer first judgment, compliance -----> business logic layer encapsulation ---------> data access layer for further secure and efficient judgment -------> result to business logic layer -------> presentation layer display result

This type of transfer is carried out step by step.

 
  • The layers are mutually dependent between the three layers. The presentation layer depends on the business layer logic, the business layer depends on the data access layer, and the three layers pass access through their own external methods.
  • Loose coupling between three layers does not affect each other, and the connection between them is accessed through the interface provided by the user;
  • Data transmission methods between layers in a three-tier structure are divided into two methods: request and response;
  • Project dependency direction: first transmitted from the presentation layer to the business layer and then to the data layer;
  • Return Value: The data layer returns data to the business logic layer, and the business logic layer returns data to the presentation layer, which then displays data in the presentation layer;

 

 

 

 

 

 

 

Thank you!

*********************************

...... 2016-10-23 ......

...... Awen ......

...... @ ^ _ ^ @......

**********************************

 

 

 

 

 

 

 

 

 

 

  

 

Related Article

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.