- 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.
- pcDuino開發(fā)實戰(zhàn)
- 精解Windows8
- Installing and Configuring Windows 10:70-698 Exam Guide
- Windows Server 2019 Administration Fundamentals
- Mobile First Design with HTML5 and CSS3
- 嵌入式實時操作系統(tǒng)μC/OS原理與實踐
- Joomla! 3 Template Essentials
- Mastering Reactive JavaScript
- 計算機系統(tǒng):基于x86+Linux平臺
- Advanced TypeScript Programming Projects
- INSTANT Galleria Howto
- HTML5 Enterprise Application Development
- Learn Quantum Computing with Python and IBM Quantum Experience
- VMware vSphere 5.1 Cookbook
- 鴻蒙HarmonyOS應(yīng)用開發(fā)從入門到精通