|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+ ------------
|
|
|
2
|
+ Layering
|
|
|
3
|
+ ------------
|
|
|
4
|
+
|
|
|
5
|
+ The sample application is layered as illustrated by this picture:
|
|
|
6
|
+
|
|
|
7
|
+[images/layers.png]
|
|
|
8
|
+
|
|
|
9
|
+ There are three vertical layers: interfaces, application and domain, each supported by different kinds of infrastructure.
|
|
|
10
|
+
|
|
|
11
|
+ * Interfaces
|
|
|
12
|
+
|
|
|
13
|
+ This layer holds everythng that interacts with other systems, such as web services, RMI interfaces
|
|
|
14
|
+ or web applications. It handles interpretation, validation and translation of incoming data. It also
|
|
|
15
|
+ handles serialization of outgoing data, such as HTML or XML across HTTP to web browsers or web service
|
|
|
16
|
+ clients, or DTO classes and distributed facade interfaces for remote Java clients.
|
|
|
17
|
+
|
|
|
18
|
+ * Application
|
|
|
19
|
+
|
|
|
20
|
+ The application layer is responsible for defining the use cases of the application, operations that can
|
|
|
21
|
+ are interface-independent and can be synchronous or message-driven. This layer is well suited for spanning
|
|
|
22
|
+ transactions, high-level logging and security.
|
|
|
23
|
+
|
|
|
24
|
+ The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects
|
|
|
25
|
+ perform the actual work.
|
|
|
26
|
+
|
|
|
27
|
+ * Domain
|
|
|
28
|
+
|
|
|
29
|
+ The domain layer is the heart of the software, and this is where the interesting stuff happens.
|
|
|
30
|
+
|
|
|
31
|
+ Everything below the domain package: domain service interfaces (and in some cases their implementations),
|
|
|
32
|
+ repository interfaces (but not the implementations!) and the domain model with each aggregate in its own
|
|
|
33
|
+ subpackage.
|
|
|
34
|
+
|
|
|
35
|
+
|
|
|
36
|
+ Infrastructure
|
|
|
37
|
+
|
|
|
38
|
+ In adition to the three vertical layers, there's also the infrastructure. As the the picture shows, it supports
|
|
|
39
|
+ all of the three layers in different ways, facilitating communication between the layers.
|
|
|
40
|
+
|
|
|
41
|
+ Hibernate mapping metadata files, Spring context definition files, logging configuration.
|
|
|
42
|
+ All external libraries,
|