Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
267 lines (221 sloc) 6.65 KB
/* Example Context Map written with 'ContextMapper DSL' */
ContextMap {
type = SYSTEM_LANDSCAPE
state = TO_BE
/* Add bounded contexts to this context map: */
contains CustomerManagementContext
contains CustomerSelfServiceContext
contains PrintingContext
contains PolicyManagementContext
contains RiskManagementContext
contains DebtCollection
/* Define the contexts relationships
*
* Note that a 'Customer-Supplier' relationship is an 'Upstream-Downstream' relationship as well (special case).
* We are aware that the syntax does not express this explicitly. We are still searching for the right syntax which
* makes this more clear. If you have any ideas or inputs and want to help us to improve this potential ambiguity,
* comment here: https://github.com/ContextMapper/context-mapper-dsl/issues/35
* Contributions are welcome!
*/
@Customer_Frontend_Backend_Relationship // Relationship name is optional
CustomerSelfServiceContext -> CustomerManagementContext : Customer-Supplier
CustomerManagementContext -> PrintingContext : Upstream-Downstream {
implementationTechnology = "SOAP"
upstream implements OPEN_HOST_SERVICE, PUBLISHED_LANGUAGE
downstream implements ANTICORRUPTION_LAYER
}
PrintingContext <- PolicyManagementContext : Upstream-Downstream {
implementationTechnology = "SOAP"
upstream implements OPEN_HOST_SERVICE, PUBLISHED_LANGUAGE
downstream implements ANTICORRUPTION_LAYER
}
RiskManagementContext <-> PolicyManagementContext : Partnership {
implementationTechnology = "RabbitMQ"
}
PolicyManagementContext -> CustomerManagementContext : Upstream-Downstream {
implementationTechnology = "RESTful HTTP"
upstream implements OPEN_HOST_SERVICE, PUBLISHED_LANGUAGE
downstream implements CONFORMIST
}
DebtCollection -> PrintingContext : Upstream-Downstream {
implementationTechnology = "SOAP"
upstream implements OPEN_HOST_SERVICE, PUBLISHED_LANGUAGE
downstream implements ANTICORRUPTION_LAYER
}
PolicyManagementContext <-> DebtCollection : Shared-Kernel {
implementationTechnology = "Shared Java Library, Communication over RESTful HTTP"
}
}
/* Bounded Context Definitions */
BoundedContext CustomerManagementContext implements CustomerManagementDomain {
type = FEATURE
domainVisionStatement = "The customer management context is responsible for managing all the data of the insurance companies customers."
implementationTechnology = "Java, JEE Application"
responsibilities = Customers, Addresses
Aggregate Customers {
Entity Customer {
aggregateRoot
- SocialInsuranceNumber sin
String firstname
String lastname
- List<Address> addresses
}
Entity Address {
String street
int postalCode
String city
}
ValueObject SocialInsuranceNumber {
String sin key
}
}
}
BoundedContext CustomerSelfServiceContext implements CustomerManagementDomain {
type = APPLICATION
domainVisionStatement = "This context represents a web application which allows the customer to login and change basic data records like the address."
responsibilities = AddressChange
implementationTechnology = "PHP Web Application"
Aggregate CustomerFrontend {
DomainEvent CustomerAddressChange {
aggregateRoot
- UserAccount issuer
- Address changedAddress
}
}
Aggregate Acounts {
Entity UserAccount {
aggregateRoot
String username
- Customer accountCustomer
}
}
}
BoundedContext PrintingContext implements PrintingDomain {
type = SYSTEM
responsibilities = Document_Printing
domainVisionStatement = "An external system which provides printing services to the other Bounded Contexts."
Aggregate Printing {
DomainEvent PrintingJob {
aggregateRoot
int printingId
- Document document
- Template template
}
Entity Document {
DomainObject source
String template
}
}
Aggregate Templating {
Entity Template {
aggregateRoot
int templateId
String templateName
}
}
}
BoundedContext PolicyManagementContext implements PolicyManagementDomain {
type = FEATURE
domainVisionStatement = "This bounded context manages the contracts and policies of the customers."
responsibilities = Offers, Contracts, Policies
implementationTechnology = "Java, Spring App"
Aggregate Offers {
Entity Offer {
aggregateRoot
int offerId
- Customer client
- List<Product> products
BigDecimal price
}
}
Aggregate Products {
Entity Product {
aggregateRoot
- ProductId identifier
String productName
}
ValueObject ProductId {
int productId key
}
}
Aggregate Contract {
Entity Contract {
aggregateRoot
- ContractId identifier
- Customer client
- List<Product> products
}
ValueObject ContractId {
int contractId key
}
Entity Policy {
int policyNr
- Contract contract
BigDecimal price
}
}
}
BoundedContext RiskManagementContext implements RiskManagementDomain {
type = FEATURE
domainVisionStatement = "Uses data from PolicyManagement context to calculate risks."
responsibilities = Customer_Risk_Calculation
implementationTechnology = "Java, Spring App"
Aggregate Risks {
Entity CustomerRiskFactor {
aggregateRoot
int totalRiskFactor
- List<Risk> risks
- Customer client
}
ValueObject Risk {
int likelihood
String risk
}
}
}
BoundedContext DebtCollection implements DebtsDomain {
type = FEATURE
domainVisionStatement = "The debt collection context is responsible for the financial income of the insurance company (the debts) which depend on the corresponding contracts and policies."
responsibilities = Debts, Dunning
implementationTechnology = "JEE"
Aggregate Debts {
Entity Debt {
aggregateRoot
int debtNr
- Policy policy
Date creationDate
Date paymentDate
Date paymentDeadline
BigDecimal price
PaymentStatus status
- List<Dunning> dunnigs
}
Entity Dunning {
int dunningNr
- Debt debt
Date dunningDate
Date paymentDeadline
}
}
}
/* Subdomain Definitions */
Subdomain CustomerManagementDomain {
type = CORE_DOMAIN
domainVisionStatement = "Subdomain managing everything customer-related."
}
Subdomain PolicyManagementDomain {
type = CORE_DOMAIN
domainVisionStatement = "Subdomain managing contracts and policies."
}
Subdomain PrintingDomain {
type = SUPPORTING_DOMAIN
domainVisionStatement = "Service (external system) to solve printing for all kinds of documents (debts, policies, etc.)"
}
Subdomain RiskManagementDomain {
type = GENERIC_SUBDOMAIN
domainVisionStatement = "Subdomain supporting everything which relates to risk management."
}
Subdomain DebtsDomain {
type = GENERIC_SUBDOMAIN
domainVisionStatement = "Subomain including everything related to the incoming money (debts, dunning, etc.)"
}