|
|
@@ -10,14 +10,14 @@ Architecture
|
|
10
|
10
|
|
|
11
|
11
|
There are three vertical layers: interfaces, application and domain, each supported by different kinds of infrastructure.
|
|
12
|
12
|
|
|
13
|
|
-* Interfaces
|
|
|
13
|
+{Interfaces}
|
|
14
|
14
|
|
|
15
|
|
- This layer holds everythng that interacts with other systems, such as web services, RMI interfaces
|
|
|
15
|
+ This layer holds everything that interacts with other systems, such as web services, RMI interfaces
|
|
16
|
16
|
or web applications, and batch processing frontends. It handles interpretation, validation and translation
|
|
17
|
17
|
of incoming data. It also handles serialization of outgoing data, such as HTML or XML across HTTP to
|
|
18
|
18
|
web browsers or web service clients, or DTO classes and distributed facade interfaces for remote Java clients.
|
|
19
|
19
|
|
|
20
|
|
-* Application
|
|
|
20
|
+{Application}
|
|
21
|
21
|
|
|
22
|
22
|
The application layer is responsible for defining the use cases of the application, operations that can
|
|
23
|
23
|
are interface-independent and can be synchronous or message-driven. This layer is well suited for spanning
|
|
|
@@ -26,19 +26,23 @@ Architecture
|
|
26
|
26
|
The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects
|
|
27
|
27
|
perform the actual work.
|
|
28
|
28
|
|
|
29
|
|
-* Domain
|
|
|
29
|
+{Domain}
|
|
30
|
30
|
|
|
31
|
31
|
The domain layer is the heart of the software, and this is where the interesting stuff happens.
|
|
32
|
32
|
There is one package per aggregate, and to each aggregate belongs entities, value objects, domain events,
|
|
33
|
|
- a repository interface and sometimes factories. The aggregate roots are Cargo, HandlingEvent, Location and Voyage.
|
|
34
|
|
-
|
|
35
|
|
- Everything about determining whether a handling event should be registered and how the delivery of a cargo
|
|
36
|
|
- is affected by handling and belongs in here. The structure and naming of aggregates, classes and methods in
|
|
37
|
|
- should follow the ubiquitous language, and you should be able to explain to a domain expert
|
|
|
33
|
+ a repository interface and sometimes factories. The aggregate roots are
|
|
|
34
|
+ <<<{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}Cargo}}>>>,
|
|
|
35
|
+ <<<{{{xref/se/citerus/dddsample/domain/model/handling/HandlingEvent.html}HandlingEvent}}>>>,
|
|
|
36
|
+ <<<{{{xref/se/citerus/dddsample/domain/model/location/Location.html}Location}}>>> and
|
|
|
37
|
+ <<<{{{xref/se/citerus/dddsample/domain/model/voyage/Voyage.html}Voyage}}>>>.
|
|
|
38
|
+
|
|
|
39
|
+ The core of the business logic, such as determining whether a handling event should be registered and how the delivery of a cargo
|
|
|
40
|
+ is affected by handling, belongs in here. The structure and naming of aggregates, classes and methods in
|
|
|
41
|
+ the domain layer should follow the ubiquitous language, and you should be able to explain to a domain expert
|
|
38
|
42
|
how this part of the software works by drawing a few simple diagrams and using the actual class- and method names
|
|
39
|
43
|
of the source code.
|
|
40
|
44
|
|
|
41
|
|
-* Infrastructure
|
|
|
45
|
+{Infrastructure}
|
|
42
|
46
|
|
|
43
|
47
|
In addition to the three vertical layers, there's also the infrastructure. As the the picture shows, it supports
|
|
44
|
48
|
all of the three layers in different ways, facilitating communication between the layers. In simple terms,
|