Bladeren bron

Added patterns reference stub.

Patrik Fredriksson 18 jaren geleden
bovenliggende
commit
362b888311

+ 2
- 1
dddsample/src/site/apt/characterization.apt Bestand weergeven

@@ -4,7 +4,6 @@
4 4
   Patrik Fredriksson
5 5
   ------------------------------------
6 6
   July 29 2008
7
-  ------------------------------------
8 7
 
9 8
   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>.
10 9
 
@@ -31,6 +30,8 @@ Domain Event
31 30
 Aggregates
32 31
 
33 32
     In real life most things are connected, directly or indirectly. Mimicking this approach when building large software systems tend to bring unnecessary complexity and poor performance. DDD provides tactics to help you sort these things out, aggregates being one of the most important ones. Aggregates help with decoupling of large structures by setting rules for relations between entities. Aggregates can also have properties, methods, and invariants that doesn't fit within one single class. Java and other OO-languages typically miss specific language constructs to handle aggregates and in the sample application responsibilities that belong to an aggregate is most often implemented in the aggregate root.

    <<<{{{xref/se/citerus/dddsample/domain/model/cargo/package-summary.html}cargo}}>>>: cargo is the central aggregate in the sample application. <<<Cargo>>> is the aggregate root and the aggregate also contains the <Value Objects> <<<DeliveryHistory>>>, <<<Itinereray>>>, <<<Leg>>> and a few more classes. 

    <<<{{{xref/se/citerus/dddsample/domain/model/handling/package-summary.html}handling}}>>>: handling is another important aggregate. It contains the HandlingEvents that are registered throughout a cargo's progress from <<<RECEIVED>>> to <<<CLAIMED>>>. The <<<HandlingEvent>>>s have a relation to the <<<Cargo>>> for which the event belongs, this is allowed since <<<HandlingEvent>>> is an aggregate root and so is <<<Cargo>>>. 

    The main reason for not making <<<HandlingEvent>>> part of the cargo aggregate is performance. <<<HandlingEvent>>>s are received from external parties and systems, e.g. warehouse management systems, port handling systems, that call our <<<{{{xref/se/citerus/dddsample/domain/service/HandlingEventService.html}HandlingEventService}}>>> webservice. The number of events can be very high and it is important that our webservice can dispatch the remote calls quickly. To be able to support this use case we need to handle the remote webservice calls asynchronously, i.e. we do not want to load the big cargo structure for each received <<<HandlingEvent>>>. Since all relationships in an aggregate must be handled synchronously we put the <<<HandlingEvent>>> in an aggregate of its own and we are able processes the events quickly and at the same time eliminate dead-locking situations in the system.

    <Editors note: We are aware that this example may need a little more work to drive the full benefits of aggregates home. This is one of the problems with a small sample app, real-world complexity is hard to simulate.>
33
+    
34
+[images/aggregates.gif]
34 35
 
35 36
 Repositories
36 37
 

+ 15
- 0
dddsample/src/site/apt/patterns-reference.apt Bestand weergeven

@@ -0,0 +1,15 @@
1
+  ------------------------------------
2
+  Patterns reference
3
+  ------------------------------------
4
+  Patrik Fredriksson
5
+  ------------------------------------
6
+  August 8, 2008
7
+  
8
+  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!

Tactical Design Patterns

*Building Blocks of a Model-Driven Design

  Aggregate
  
9
+  Entity
  
10
+  Value Object
  
11
+  Repository
  
12
+  Service
  
13
+  Specification

  Layered Architecture
14
+  
15
+  Service Layer

Strategic Design Patterns

  Anti-corruption Layer

dddsample/doc/aggregates.gif → dddsample/src/site/resources/images/aggregates.gif Bestand weergeven


+ 1
- 0
dddsample/src/site/site.xml Bestand weergeven

@@ -17,6 +17,7 @@
17 17
     <menu name="About the application">
18 18
       <item name="Introduction" href="index.html"/>
19 19
       <item name="Characterization" href="characterization.html"/>
20
+      <item name="Patterns Reference" href="patterns-reference.html"/>
20 21
       <item name="Download" href="download.html"/>
21 22
       <item name="Roadmap" href="roadmap.html" />
22 23
     </menu>