Layer 3 theory 1

Source: Internet
Author: User

1. Contact Life:

Let's start with our daily life scenarios. We need to have a barbecue. In one case, there is a stall on the side of the road. After we finish the food, we will watch it waiting for roasting, and then we will start eating it, in the second case, when we arrive at a store, we just need to sit down and ask what you want to eat, after you finish, someone will send you what you want (both of these scenarios are estimated to have been used)

Barbecue process in two scenarios:



In our daily life, this barbecue phenomenon corresponds to two methods developed by our system: Layer 2 and Layer 3 ).

When a person is always busy with barbecue, he may open a shop after accumulating a certain amount of money, so that he can satisfy more customers.

The process from roadside barbecue to shop opening is the same as the process of software development. At the beginning, we were also putting all the functions (data input, logical operations, and database access updates) are written in a form, and then the software is divided into the interface layer, the logic layer, and the data access layer. The transition from Layer 2 to Layer 3 is realized.


2. Layer 2 diagram:

Features: Strong Coupling



Layer 3

Definition: Layer-3 is to logically divide the software into three layers and implement their respective functions separately.

 

Presentation LayerUI: Only input data and display data: provides an interactive system interface.

Business logic layerBll: A bridge between the presentation layer and the data access layer. It is responsible for the logical operations, processing, and transmission of data.

Data access layerDal: Directly targets database operations, and adds, deletes, modifies, and queries databases to update data.

Illustration:


Layer understanding:

A layer is a weak coupling structure. The dependency between the layer is downward, and the underlying layer is "ignorant" for the upper layer, changing the design of the upper layer has no impact on the underlying layer of its calls. If the hierarchical design follows the interface-oriented design idea, this downward dependency should also be a weak dependency. Therefore, without changing the interface definition, the ideal layered architecture should be a "drawer" architecture that supports extraction and replacement.

 

Core:

The business logic layer is the core part of the three layers.

After understanding the layer, we can know that the design of the business logic layer is particularly critical to a scalable architecture because it plays two different roles. For the data access layer, it is the caller; for the presentation layer, it is the caller. Dependency and dependency are all entangled in the business logic layer. How to decouple dependency is another major task besides implementing business logic.

The middle layer separates complex business logic (business rules, data access, and legality verification) from the traditional double-layer application model, it also provides scalable, easy-to-access, and easy-to-manage methods to encapsulate and deploy a variety of application services on the Application Server separately, at the same time, it enhances application availability, security, encapsulation reusability, scalability and portability, and minimizes the time spent on management, thus, enterprise-level system applications are convenient, efficient, secure, and stable.

 

Layer 3 theory 1

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.