|
|
@@ -8,7 +8,7 @@ Architecture
|
|
8
|
8
|
|
|
9
|
9
|
[images/layers.png]
|
|
10
|
10
|
|
|
11
|
|
- There are three vertical layers: interfaces, application and domain, each supported by different kinds of infrastructure.
|
|
|
11
|
+ There are three vertical layers: Interfaces, Application and Domain, each supported by different kinds of infrastructure.
|
|
12
|
12
|
|
|
13
|
13
|
{Interfaces}
|
|
14
|
14
|
|
|
|
@@ -23,8 +23,8 @@ Architecture
|
|
23
|
23
|
are interface-independent and can be synchronous or message-driven. This layer is well suited for spanning
|
|
24
|
24
|
transactions, high-level logging and security.
|
|
25
|
25
|
|
|
26
|
|
- The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects
|
|
27
|
|
- perform the actual work.
|
|
|
26
|
+ The application layer is thin in terms of domain logic - it merely coordinates workflow and delegates to the domain
|
|
|
27
|
+ layer objects to perform the actual work.
|
|
28
|
28
|
|
|
29
|
29
|
{Domain}
|
|
30
|
30
|
|
|
|
@@ -39,12 +39,12 @@ Architecture
|
|
39
|
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
|
40
|
is affected by handling, belongs in here. The structure and naming of aggregates, classes and methods in
|
|
41
|
41
|
the domain layer should follow the ubiquitous language, and you should be able to explain to a domain expert
|
|
42
|
|
- how this part of the software works by drawing a few simple diagrams and using the actual class- and method names
|
|
|
42
|
+ how this part of the software works by drawing a few simple diagrams and using the actual class and method names
|
|
43
|
43
|
of the source code.
|
|
44
|
44
|
|
|
45
|
45
|
{Infrastructure}
|
|
46
|
46
|
|
|
47
|
|
- In addition to the three vertical layers, there's also the infrastructure. As the the picture shows, it supports
|
|
|
47
|
+ In addition to the three vertical layers, there is also the infrastructure. As the the picture shows, it supports
|
|
48
|
48
|
all of the three layers in different ways, facilitating communication between the layers. In simple terms,
|
|
49
|
49
|
the infrastructure consists of everything that exists independently of our application: external libraries,
|
|
50
|
50
|
database engine, application server, messaging backend and so on.
|
|
|
@@ -53,6 +53,6 @@ Architecture
|
|
53
|
53
|
Looking for example at the persistence aspect, the database schema definition, Hibernate configuration and mapping files
|
|
54
|
54
|
and implementations of the repository interfaces are part of the infrastructure layer.
|
|
55
|
55
|
|
|
56
|
|
- While it can be tricky to give a waterproof definition of what kind of code belongs to the infrastructure layer for any given situation,
|
|
|
56
|
+ While it can be tricky to give a solid definition of what kind of code belongs to the infrastructure layer for any given situation,
|
|
57
|
57
|
it should be possible to completely stub out the infrastructure in pure Java unit/scenario tests and still be able to
|
|
58
|
58
|
use the domain layer and possibly the application layer to work out the core business problems.
|