3-tier Application csdn

Three layer architecture (3-tier application) usually sense of three layer structure is the whole business application is divided into: the presentation layer (UI), business logic layer (BLL), data access layer (DAL). Distinguish between levels in order to "the purpose of high cohesion and low coupling" thought. 

Concept introduction 

1, the presentation layer (UI) : popular speak be show the user's interface, which users in the use of a system he had saw income. 

2, the business logic layer (BLL) : according to the operation of the specific problems, also can saying is the operation on data layer, data processing of business logic. 

3, data access layer: this layer (DAL) do direct operation, and in the database transaction data to add, delete, modify, updating, and search. 

 

Sketch

In the software architecture design, a hierarchical structure is the most common, and most important structure. Microsoft recommended a hierarchical structure generally divided into three layers, respectively from the first data access layer, business logic layer (or become field layer), said layer. 

Three layer structure principle: 

Three levels of the system, main functions and business logic are in business logic layer for processing. 

The so-called three system structure, is in the client database and between joined a "intermediate", also called component layer. Here said the three system, not a physical three layers, not simply placed three machines are three layer system structure, also not only only B/S application is three system structure, three layer is refers to the logic of the three layers, even if the three layer placed in a machine. 

Three layers of the system application will business rules, data access, legitimacy and work on the intermediate check for processing. Usually, the client not to interact directly with the database, but through the COM/DCOM communication interface layer and establish a connection, again through intermediate to interact with the database. 

Said layer 

Located in the outer (top) from users, recently. Used to display data and receive user input data, to provide an interactive operation interface. 

Business logic layer 

Business Logic Layer (Layer) is undoubtedly get based system architecture are reflected in the core value of parts. It concerns mainly in the business rules of the system, the realization of the business process and the needs of the business about the system design, also is say that it is and system of the field to deal with (by) logic, and many times, will also business logic layer called the field layer. For example Martin Fowler Patterns of the Enterprise Application in the Architecture "in one book, the whole structure is divided into three main layer: the presentation layer, layer and the data source layer. Field As a field of driving design pioneer the Eric Evans, the business logic layer is more meticulous divided, subdivision and field application layer, layer by layer further will field logic and the domain logic solutions separation. 

Business logic layer in the system architecture of the location is very key, it is in data access layer and layer, and played the said among data exchange connecting link between the preceding and the role. Due to the layer is a kind of weak coupling structure, the dependencies between layer and layer is down, for it is the upper "ignorant", the change of the design for the upper of the ground floor of call is no influence. If in the layering design, follow the face interface design thought, so this downward rely on should also is a kind of weak dependencies. So don't change interface definitions in the premise of hierarchical structure, the ideal, should be a support can extract, can replace "drawer" type structure. Because of this, the business logic layer design for a support extensible framework was key, because it played two different roles. The data access layer, it's the caller; For the presentation layer is concerned, it is be caller. Rely on and rely on relationships are back in business logic layer, how to realize decoupling of dependence, is in addition to achieve business logic to outside designer's task. 

Data layer 

Data access layer: sometimes also called is the lasting layer, its function is mainly responsible for the database access, can access database system, binary, text documents or XML document. 

The simple view is make the data table the Select, Insert, Update, and Delete operation. If you want to join the ORM elements, then it will include object and the data table, and between the object of the entity fang persistent. 

Advantages and disadvantages 

advantages 

1, the developers can only pay attention to the whole structure of one layer; 

2, can easily use new implementation to replace the original level of the implementation; 

3, can reduce the dependencies between layer and layer; 

4 and conducive to standardization; 

5, each layer of the logic for reuse. 

faults 

1, reduce the performance of the system. This is self-evident. If does not use the hierarchical structure, many business can directly obtain corresponding to visit the database, data, but are now must through the middle to complete. 

2, sometimes led to a cascade of modification. These changes in its top-down direction. If the said layer in the need to add a function, in order to ensure its hierarchical structure designed to meet and may need in the corresponding business logic layer and data access layer increased in the corresponding code. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值