CML Reference - Introduction
Language Semantics
Context Map
Bounded Context
Domain and Subdomain
Domain Vision Statement
Partnership
Shared Kernel
Customer/Supplier
Conformist
Open Host Service
Anticorruption Layer
Published Language
Responsibility Layers
Knowledge Level
Aggregate
Tactic DDD Syntax
Application and Process Layer
User Requirements
Stakeholders
Value Registers
Imports
Architectural Refactorings
AR-1: Split Aggregate by Entities
AR-2: Split Bounded Context by Features
AR-3: Split Bounded Context by Owner
AR-4: Extract Aggregates by Volatility
AR-5: Extract Aggregates by Cohesion
AR-6: Merge Aggregates
AR-7: Merge Bounded Contexts
AR-8: Extract Shared Kernel
AR-9: Suspend Partnership
AR-10: Change Shared Kernel to Partnership
AR-11: Change Partnership to Shared Kernel
Imports
CML models can be divided into multiple *.cml
files. For example, you may want to specify Bounded Contexts in separate files and use them in multiple Context Maps.
One *.cml
file can only contain one Context Map. However, multiple Context Maps in separate *.cml
files can import the same files describing the Bounded Contexts.
Example
The following CML snippet could be in a file BoundedContexts.cml
and specify some Bounded Contexts:
BoundedContext CustomerManagementContext implements CustomerManagementDomain {
Aggregate Customers {
Entity Customer {
aggregateRoot
- SocialInsuranceNumber sin
String firstname
String lastname
- List<Address> addresses
}
Entity Address {
String street
int postalCode
String city
}
}
}
BoundedContext PolicyManagementContext implements PolicyManagementDomain {
Aggregate Contract {
Entity Contract {
aggregateRoot
- ContractId identifier
- Customer client
- List<Product> products
}
Entity Policy {
int policyNr
- Contract contract
BigDecimal price
}
}
}
A file containing the ContextMap can then import the Bounded Contexts with the import keyword:
import "./BoundedContexts.cml"
ContextMap InsuranceContextMap {
contains CustomerManagementContext
contains PolicyManagementContext
PolicyManagementContext [D,CF]<-[U,OHS,PL] CustomerManagementContext {
implementationTechnology = "RESTfulHTTP"
exposedAggregates = Customers
}
}
It is also possible to import *.cml
files located in other directories:
import "./BoundedContexts/CustomerManagement.cml"
import "./BoundedContexts/PolicyManagement.cml"
ContextMap InsuranceContextMap {
contains CustomerManagementContext
contains PolicyManagementContext
PolicyManagementContext [D,CF]<-[U,OHS,PL] CustomerManagementContext {
implementationTechnology = "RESTfulHTTP"
exposedAggregates = Customers
}
}
Note: Although you can import *.cml files from different directories, our Eclipse plugin will only be able to resolve files within the same Eclipse project.
- Previous
- Next