Welcome

Context Mapper provides a DSL to create context maps based on Domain-driven Design (DDD) and its strategic patterns. The model behind the language and its semantic rules aim to formalize our interpretation of the DDD patterns and how they can be combined in a concise manner. DDD and its bounded contexts further provide an approach for decomposing a domain into multiple bounded contexts. With our Service Cutter integration (proof-of-concept) we illustrate how the Context Mapper DSL (CML) can be used as a foundation for structured service decomposition approaches. Additionally, our context maps can be transformed into PlantUML models (proof-of-concept).

The Context Mapper project has been developed in a term project at HSR. You can find further background information and details in the project report, “A Domain-specific Language for Service Decomposition”.

Getting started

To start with Context Mapper install our Eclipse plugin by using the following update site: https://dl.bintray.com/contextmapper/context-mapping-dsl/updates/.

System Requirements

To use the ContextMapper DSL you need the following tools:

CML Models

As soon as you have installed our Eclipse plugin, you can start creating context maps. Start with a new context map by creating a file with the file extension .cml.

Checkout our examples repository to find examples of complete context maps. One of the examples is the DDD Sample Application. The following CML code snippets give you a first impression how the DSL looks like.

The context map for the DDD Sample Application which is split into three bounded contexts:

/** 
 * The DDD Cargo sample application modeled in CML. Note that we split the application into 
 * multiple bounded contexts.
 *
 */
ContextMap {
  contains CargoBookingContext
  contains VoyagePlanningContext
  contains LocationContext
  
  CargoBookingContext [SK]<->[SK] VoyagePlanningContext
  
  CargoBookingContext [D]<-[U,OHS,PL] LocationContext

  VoyagePlanningContext [D]<-[U,OHS,PL] LocationContext
}

The bounded contexts have to be specified before you can use them within a context map. A simple example of a bounded context definition:

BoundedContext LocationContext {
  Module location {
    Aggregate Location {
      Entity Location {
        aggregateRoot

        PortCode portcode
        - UnLocode unLocode
          String name
      }

      ValueObject UnLocode {
        String unLocode
      }

      ValueObject LocationShared {
        PortCode portCode
        - Location location
      }
    }
  }
}

Note that the DSL elements within the modules and aggregates is based on the Sculptor DSL. You find a documentation regarding the syntax for the tactic DDD patterns here.

Domain-driven Design Patterns

Strategic Patterns

Find a list of all supported strategic DDD patterns here.

Tactic Patterns

The implementation of the tactic DDD patterns is based on Sculptor DSL. You can find their documentation and the supported patterns under the following link: http://sculptorgenerator.org/documentation/.

Transformations / Generators

Context Mapper provides tools to transform CML models to ServiceCutter input and plantUML diagrams.

Service Cutter Integration

Find out here how to produce Service Cutter input to calculate possible service cuts or new bounded contexts:

Service Cutter DDD Sample

plantUML Diagrams

You can generate plantUML component diagrams out of CML context maps. Additionally, the transformation generates class diagrams for all bounded contexts. Here you can find out how to generate them.

Example component diagram (DDD sample): DDD Sample Component Diagram

Example class diagram (Cargo booking context): Cargo Booking Context