- Java EE 8 Design Patterns and Best Practices
- Rhuan Rocha Jo?o Purifica??o
- 208字
- 2021-07-23 16:54:55
Layers
A layer is merely a logical division that has a responsibility within the architecture of the application. It is a logical way to organize the application code. Martin Fowler's book Patterns of Enterprise Application Architecture describes the three main layers and their responsibilities:

Thus, the classes of an application are logically separated according to their responsibilities. There are classes that are used in the data-access layer, while other classes prepare the data to be displayed as part of the presentation layer. This division is purely logical. A good architecture practice is to have a layered chain where a layer interacts with its adjacent layer, providing and consuming services. This leads to more cohesion (the same responsibilities are contained in the same layer) and low-coupling.
Let's look at the following diagram:
We can see that the JSF, JSP, and HTML pages, the bean-backing class, and even a servlet belong logically to the presentation layer group, since they have the same basic responsibility, which is to send information to the user and receive requests from a user. An EJB, a servlet (part of it), and a Business Object belong to the business layer. The DAO classes and the JPA entities belong to the data layer.
- Linux設(shè)備驅(qū)動(dòng)開發(fā)詳解:基于最新的Linux4.0內(nèi)核
- Kubernetes修煉手冊
- Learning OpenDaylight
- Extending Puppet
- Windows Vista融會(huì)貫通
- Windows Phone應(yīng)用程序開發(fā)
- Python基礎(chǔ)教程(第3版)
- Windows Server 2012網(wǎng)絡(luò)操作系統(tǒng)企業(yè)應(yīng)用案例詳解
- Linux系統(tǒng)安全基礎(chǔ):二進(jìn)制代碼安全性分析基礎(chǔ)與實(shí)踐
- AutoCAD 2014中文版從入門到精通
- 云原生落地:產(chǎn)品、架構(gòu)與商業(yè)模式
- 新編電腦辦公(Windows 10+ Office 2013版)從入門到精通
- Kali Linux高級(jí)滲透測試(原書第3版)
- Linux系統(tǒng)最佳實(shí)踐工具:命令行技術(shù)
- 鴻蒙操作系統(tǒng)設(shè)計(jì)原理與架構(gòu)