-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathdemo.cml
79 lines (67 loc) · 2.27 KB
/
demo.cml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* The DDD Cargo sample application modeled in CML. Note that we split the application into multiple bounded contexts. */
ContextMap DDDSampleMap {
contains CargoBookingContext
contains VoyagePlanningContext
contains LocationContext
/* As Evans mentions in his book (Bounded Context chapter): The voyage planning can be seen as
* separated bounded context. However, it still shares code with the booking application (CargoBookingContext).
* Thus, they are in a 'Shared-Kernel' relationship.
*/
CargoBookingContext [SK]<->[SK] VoyagePlanningContext
/* Note that the splitting of the LocationContext is not mentioned in the original DDD sample of Evans.
* However, locations and the management around them, can somehow be seen as a separated concept which is used by other
* bounded contexts. But this is just an example, since we want to demonstrate our DSL with multiple bounded contexts.
*/
CargoBookingContext [D]<-[U,OHS,PL] LocationContext
VoyagePlanningContext [D]<-[U,OHS,PL] LocationContext
}
/* The original booking application context */
BoundedContext CargoBookingContext {
Module cargo {
basePackage = se.citerus.dddsample.domain.model
Aggregate CargoItineraryLegDeliveryRouteSpecification {
Entity Cargo
ValueObject Delivery
ValueObject HandlingActivity
ValueObject Itinerary
ValueObject Leg
ValueObject RouteSpecification
enum TransportStatus {
NOT_RECEIVED, IN_PORT, ONBOARD_CARRIER, CLAIMED, UNKNOWN
}
enum RoutingStatus {
NOT_ROUTED, ROUTED, MISROUTED
}
}
}
Module handling {
basePackage = se.citerus.dddsample.domain.model
Aggregate Handling {
DomainEvent HandlingEvent
ValueObject HandlingHistory
}
}
}
/* We split the Voyage Planning into a separate bounded context as Evans proposes it in his book. */
BoundedContext VoyagePlanningContext {
Module voyage {
basePackage = se.citerus.dddsample.domain.model
Aggregate Voyage {
Entity Voyage
ValueObject CarrierMovement
ValueObject Schedule
ValueObject VoyageNumber
}
}
}
/* Separate bounded context for managing the locations. */
BoundedContext LocationContext {
Module location {
basePackage = se.citerus.dddsample.domain.model
Aggregate Location {
Entity Location
ValueObject UnLocode
ValueObject LocationShared
}
}
}