Преглед изворни кода

Documentation updates.

Made a couple of dependencies explicit to work around deficiencies in the Eclipse plugin.
peter_backlund пре 17 година
родитељ
комит
dccfe277c9

+ 9
- 3
dddsample/pom.xml Прегледај датотеку

@@ -156,11 +156,12 @@
156 156
       <plugin>
157 157
         <artifactId>maven-assembly-plugin</artifactId>
158 158
         <configuration>
159
-          <descriptorRefs>
160
-            <descriptorRef>src</descriptorRef>
161
-          </descriptorRefs>
159
+          <descriptors>
160
+            <descriptor>src/main/assembly/assembly.xml</descriptor>
161
+          </descriptors>
162 162
         </configuration>
163 163
       </plugin>
164
+      
164 165
     </plugins>
165 166
   </build>
166 167
   <dependencies>
@@ -177,6 +178,11 @@
177 178
     </dependency>
178 179
     <dependency>
179 180
       <groupId>org.springframework</groupId>
181
+      <artifactId>spring-web</artifactId>
182
+      <version>${spring.version}</version>
183
+    </dependency>
184
+    <dependency>
185
+      <groupId>org.springframework</groupId>
180 186
       <artifactId>spring</artifactId>
181 187
       <version>${spring.version}</version>
182 188
       <exclusions>

+ 27
- 15
dddsample/src/site/apt/architecture.apt Прегледај датотеку

@@ -1,21 +1,23 @@
1 1
   ------------
2
-  Layering
2
+  Architecture
3 3
   ------------
4 4
 
5
+Architecture
6
+
5 7
   The sample application is layered as illustrated by this picture:
6 8
 
7 9
 [images/layers.png]
8 10
 
9 11
   There are three vertical layers: interfaces, application and domain, each supported by different kinds of infrastructure.
10 12
 
11
-  * Interfaces
13
+* Interfaces
12 14
 
13 15
 	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.
16
+	or web applications, and batch processing frontends. It handles interpretation, validation and translation
17
+	of incoming data. It also handles serialization of outgoing data, such as HTML or XML across HTTP to
18
+	web browsers or web service clients, or DTO classes and distributed facade interfaces for remote Java clients.
17 19
 
18
-  * Application
20
+* Application
19 21
 
20 22
     The application layer is responsible for defining the use cases of the application, operations that can
21 23
     are interface-independent and can be synchronous or message-driven. This layer is well suited for spanning
@@ -24,19 +26,29 @@
24 26
     The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects
25 27
     perform the actual work.
26 28
 
27
-  * Domain
29
+* Domain
28 30
 
29 31
 	The domain layer is the heart of the software, and this is where the interesting stuff happens.
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.
30 34
 
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.
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
38
+	how this part of the software works by drawing a few simple diagrams and using the actual class- and method names
39
+	of the source code.
34 40
 
41
+* Infrastructure
35 42
 
36
-	Infrastructure
43
+	In addition to the three vertical layers, there's also the infrastructure. As the the picture shows, it supports
44
+	all of the three layers in different ways, facilitating communication between the layers. In simple terms,
45
+	the infrastructure consists of everything that exists independently of our application: external libraries,
46
+	database engine, application server, messaging backend and so on.
37 47
 
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.
48
+	Also, we consider code and configuration files  that glues the other layers to the infrastructure as part of the infrastructure layer.
49
+	Looking for example at the persistence aspect, the database schema definition, Hibernate configuration and mapping files
50
+	and implementations of the repository interfaces are part of the infrastructure layer.
40 51
 
41
-    Hibernate mapping metadata files, Spring context definition files, logging configuration.
42
-    All external libraries,  
52
+	While it can be tricky to give a waterproof definition of what kind of code belongs to the infrastructure layer for any given situation,
53
+	it should be possible to completely stub out the infrastructure in pure Java unit/scenario tests and still be able to
54
+	use the domain layer and possibly the application layer to work out the core business problems.

+ 2
- 0
dddsample/src/site/apt/characterization.apt Прегледај датотеку

@@ -5,6 +5,8 @@
5 5
   ------------------------------------
6 6
   March 11, 2009
7 7
 
8
+Characterization
9
+
8 10
   Careful characterization of the classes is an important activity when doing Domain-Driven Design. Sometimes it is fairly obvious in what category a particular class belongs, other times it is not as easy to sort out the different <Building Blocks of a Model-Driven Design>.
9 11
 
10 12
   The trickiest ones to classify are typically <Entities>, <Aggregates>, <Value Objects> and <Domain Events>. When possible, we tend to favor <Value Objects> over <Entities> or <Domain Events>, because they require less attention during implementation. <Value Objects> can be created and thrown away at will, and since they are immutable we can pass them around as we wish. We must be much less cavalier with <Entities> as identity and life-cycle have to be carefully managed. Below is a short walkthrough of key classes in the application and the motivation behind their implementation choice. All but <Domain Event> are thoroughly described in {{{http://www.domaindrivendesign.org/books/index.html#DDD}Eric Evans' book}}. A short introduction to Domain Events can be found here: {{http://martinfowler.com/eaaDev/DomainEvent.html}}

+ 9
- 26
dddsample/src/site/apt/download.apt Прегледај датотеку

@@ -2,7 +2,7 @@
2 2
   Download
3 3
   --------
4 4
 
5
-Prerequisites
5
+Download
6 6
 
7 7
   * Java 6 or later
8 8
 
@@ -16,10 +16,9 @@ Prerequisites
16 16
 
17 17
 Downloads
18 18
 
19
-    There are three different {{{http://sourceforge.net/project/showfiles.php?group_id=210606}downloads}} available:
20
-    the {{{http://downloads.sourceforge.net/dddsample/dddsample-1.0-src.zip?use_mirror=osdn} source package}},
21
-    the {{{http://downloads.sourceforge.net/dddsample/IncidentLoggingApplication.zip?use_mirror=osdn} Incident Logging Application}}
22
-    and the {{{http://downloads.sourceforge.net/dddsample/dddsample-1.0.war?use_mirror=osdn} pre-built web archive}}.
19
+    There are two {{{http://sourceforge.net/project/showfiles.php?group_id=210606}downloads}} available:
20
+    the core application {{{http://downloads.sourceforge.net/dddsample/dddsample-1.0-src.zip?use_mirror=osdn} source package}},
21
+    and the {{{http://downloads.sourceforge.net/dddsample/IncidentLoggingApplication.zip?use_mirror=osdn} Incident Logging Application}}.
23 22
 
24 23
     The project uses Maven for build and management.
25 24
 
@@ -41,9 +40,7 @@ mvn clean package
41 40
 mvn jetty:run
42 41
 -------------
43 42
 
44
-    The public tracking interface is available at {{http://localhost:8080/dddsample}}
45
-    and the booking and routing administration interface can be found at {{http://localhost:8080/dddsample/admin/list.html}}.
46
-    The administration interface is used for booking and routing cargo.
43
+    The start page is available at {{http://localhost:8080/dddsample}}, and has links to the various interfaces.
47 44
 
48 45
 	There is a screencast available on the project site that demonstrates how the different interfaces are used.
49 46
 
@@ -72,17 +69,6 @@ java -jar IncidentLoggingApplication.jar
72 69
 
73 70
     The source code for this application is currently only available {{{source-repository.html}in Subversion}}.
74 71
 
75
-* Pre-built web archive 
76
-
77
-    Download {{{http://downloads.sourceforge.net/dddsample/dddsample-1.0.war?use_mirror=osdn} here}}
78
-
79
-    This is a pre-built standard .war, ready to be deployed in a standard servlet container such as Tomcat. It is
80
-    offered as a convenience if you want a simple way to run the application without bothering with the build
81
-    environment. Developers who are interested in how DDD is applied in the application should download the source
82
-    archive instead.
83
-
84
-    The same caveats for running the application that are listed in the source package section above apply to this package as well.
85
-
86 72
 IDE Setup
87 73
 
88 74
     * IntelliJ 7 or later:
@@ -95,14 +81,11 @@ IDE Setup
95 81
 
96 82
     * Eclipse
97 83
 
98
-      Either install a Maven integration plugin ({{{http://code.google.com/p/q4e/} q4e}} recommended), or
99
-      use standalone Maven to {{{http://maven.apache.org/plugins/maven-eclipse-plugin/}generate project descriptor files}}.
100
-
101
-    * Other
102
-
103
-      Use standalone Maven to generate project descriptor files for your IDE.
84
+      Eclipse support for Maven is still a bit rocky, so project descriptor files have been
85
+      committed into the repository so that the project can immediately be opened with no further
86
+      configuration.
104 87
 
105
-About Maven
88
+About Maven          pom
106 89
 
107 90
     Maven downloads all external library dependencies and plugins separately, which can amount to quite a large number of
108 91
     small files that are downloaded sequentially. These are all cached locally, but the first time you run it you should

+ 12
- 4
dddsample/src/site/apt/index.apt Прегледај датотеку

@@ -13,7 +13,7 @@
13 13
   implementation of the building block patterns as well as illustrate the
14 14
   impact of aggregates and bounded contexts.
15 15
 
16
-  The application can have various uses:
16
+Purpose
17 17
 
18 18
   * A how-to example for implementing a typical DDD application
19 19
 
@@ -35,9 +35,17 @@
35 35
     with the "conventional" implementation, which can demonstrate the value of the new platform
36 36
     and provide validation or other feedback to the developers of the platform.
37 37
 
38
-  []
39
-  
38
+Caveats
39
+
40
+  	Domain-driven design is a very broad topic, and contains lots of things that are difficult or impossible
41
+    to incorporate into the code base of a sample application, most importantly communication with the domain
42
+    expert, iterative modelling and the discovery of a ubiquitous language. This application is a snapshot in time,
43
+    the result of a development effort that you need to imagine has been utilizing domain-driven design,
44
+    to show how one can structure an application around an isolated, rich domain model in a realistic environment.
45
+
46
+	[]
47
+
40 48
   <This project is a joint effort by Eric Evans' company {{{http://www.domainlanguage.com}Domain Language}}
41
-  and Swedish software consulting company {{{http://www.citerus.se}Citerus}}.>
49
+  and the Swedish software consulting company {{{http://www.citerus.se}Citerus}}.>
42 50
 
43 51
 

+ 1
- 1
dddsample/src/site/apt/patterns-reference.apt Прегледај датотеку

@@ -1 +1 @@
1
-  ------------------------------------
  Patterns reference
  ------------------------------------
  Patrik Fredriksson
  ------------------------------------
  March 11, 2009
  
  In {{{http://www.domaindrivendesign.org/books/index.html#DDD}Eric Evans' book}} a number of patterns on Domain-Driven Design are presented. Many of these patterns are implemented in the sample application. Use this patterns reference to find out which patterns are implemented where!
  
  A patterns summary can be downloaded at {{{http://www.domaindrivendesign.org/discussion/index.html}domaindrivendesign.org}}.

Tactical Design Patterns

*Building Blocks of a Model-Driven Design

  Aggregate [{{{characterization.html#Aggregates}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/package-summary.html}code example}}]
  
  Domain Event [{{{characterization.html#Domain_Event}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/handling/HandlingEvent.html}code example}}]
  
  Entity [{{{characterization.html#Entities}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  
  Value Object [{{{characterization.html#Value_Objects}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/Leg.html}code example}}]
  
  Repository [{{{characterization.html#Repositories}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/CargoRepository.html}code example}}]
  
  Service [{{{characterization.html#Services}discussion}}] [{{{xref/se/citerus/dddsample/domain/service/RoutingService.html}code example}}]
  
  Specification [{{{xref/se/citerus/dddsample/domain/model/cargo/RouteSpecification.html}code example}}]

  Layered Architecture [discussion]
  
  Service Layer [{{{characterization.html#Services}discussion}}]
  
*Supple Design

  Intention-Revealing Interfaces [discussion] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  
  Side-Effect-Free Functions [discussion] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  

Strategic Design Patterns

*Maintaining Model Integrity

  Anti-corruption Layer [discussion] [{{{xref/se/citerus/dddsample/interfaces/handling/ws/HandlingReportServiceImpl.html}code example}}]
1
+  ------------------------------------
  Patterns reference
  ------------------------------------
  Patrik Fredriksson
  ------------------------------------
  March 11, 2009

Patterns reference

  In {{{http://www.domaindrivendesign.org/books/index.html#DDD}Eric Evans' book}} a number of patterns on Domain-Driven Design are presented. Many of these patterns are implemented in the sample application. Use this patterns reference to find out which patterns are implemented where!
  
  A patterns summary can be downloaded at {{{http://www.domaindrivendesign.org/discussion/index.html}domaindrivendesign.org}}.

Tactical Design Patterns

*Building Blocks of a Model-Driven Design

  Aggregate [{{{characterization.html#Aggregates}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/package-summary.html}code example}}]
  
  Domain Event [{{{characterization.html#Domain_Event}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/handling/HandlingEvent.html}code example}}]
  
  Entity [{{{characterization.html#Entities}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  
  Value Object [{{{characterization.html#Value_Objects}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/Leg.html}code example}}]
  
  Repository [{{{characterization.html#Repositories}discussion}}] [{{{xref/se/citerus/dddsample/domain/model/cargo/CargoRepository.html}code example}}]
  
  Service [{{{characterization.html#Services}discussion}}] [{{{xref/se/citerus/dddsample/domain/service/RoutingService.html}code example}}]
  
  Specification [{{{xref/se/citerus/dddsample/domain/model/cargo/RouteSpecification.html}code example}}]

  Layered Architecture [discussion]
  
  Service Layer [{{{characterization.html#Services}discussion}}]
  
*Supple Design

  Intention-Revealing Interfaces [discussion] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  
  Side-Effect-Free Functions [discussion] [{{{xref/se/citerus/dddsample/domain/model/cargo/Cargo.html}code example}}]
  

Strategic Design Patterns

*Maintaining Model Integrity

  Anti-corruption Layer [discussion] [{{{xref/se/citerus/dddsample/interfaces/handling/ws/HandlingReportServiceImpl.html}code example}}]

+ 1
- 0
dddsample/src/site/site.xml Прегледај датотеку

@@ -4,6 +4,7 @@
4 4
     <src>images/banner-left.png</src>
5 5
     <href>http://dddsample.sf.net</href>
6 6
   </bannerLeft>
7
+  <version position="left"/>
7 8
   <poweredBy>
8 9
     <logo name="Sourceforge" href="http://sourceforge.net/"
9 10
           img="http://sflogo.sourceforge.net/sflogo.php?group_id=210606&amp;type=2"/>