Context Map Generator

Introduction

Our Context Map generator produces graphical representations of Context Mapper DSL (CML) Context Maps. The visualization of the generated Context Maps is inspired by the illustration style proposed by Vernon and Brandolini.

Examples

The following CML Context Map represents the DDD cargo sample application (find the complete CML file here):

ContextMap DDDSampleMap {
  contains CargoBookingContext
  contains VoyagePlanningContext
  contains LocationContext

  CargoBookingContext [SK]<->[SK] VoyagePlanningContext

  CargoBookingContext [D]<-[U,OHS,PL] LocationContext

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

Using our generator produces the following graphical Context Map for you:

DDD Cargo Sample Application Context Map

As a second example, the following Context Map represents our insurance company example (find the complete CML file here):

ContextMap InsuranceContextMap {
  type = SYSTEM_LANDSCAPE
  state = TO_BE

  /* Add bounded contexts to this context map: */
  contains CustomerManagementContext, CustomerSelfServiceContext, PrintingContext
  contains PolicyManagementContext, RiskManagementContext, DebtCollection

  /* Define the context relationships: */

  CustomerSelfServiceContext [D,C]<-[U,S] CustomerManagementContext {
    exposedAggregates = Customers
  }

  CustomerManagementContext [D,ACL]<-[U,OHS,PL] PrintingContext {
    implementationTechnology = "SOAP"
    downstreamRights = INFLUENCER
    exposedAggregates = Printing
  }

  PrintingContext [U,OHS,PL]->[D,ACL] PolicyManagementContext {
    implementationTechnology = "SOAP"
    exposedAggregates = Printing
  }

  RiskManagementContext [P]<->[P] PolicyManagementContext {
    implementationTechnology = "RabbitMQ"
  }

  PolicyManagementContext [D,CF]<-[U,OHS,PL] CustomerManagementContext {
    implementationTechnology = "RESTfulHTTP"
    exposedAggregates = Customers
  }

  DebtCollection [D,ACL]<-[U,OHS,PL] PrintingContext {
    implementationTechnology = "SOAP"
    exposedAggregates = Printing
  }

  PolicyManagementContext [SK]<->[SK] DebtCollection {
    implementationTechnology = "Shared Java Library, Communication over RESTful HTTP"
  }
}

Our generator produces the following graphical result for the above Context Map:

Insurance Company Example Context Map

Besides Context Maps of the type SYSTEM_LANDSCAPE, CML allows you to create maps that illustrate which development teams work on which subsystems or components (Context Map type ORGANZATIONAL). The following CML example illustrates how this can be done:

ContextMap InsuranceTeamMap {
  type = ORGANIZATIONAL
  state = TO_BE
  
  /* Add contexts that represent subsystems/components to this organizational map: */
  contains CustomerManagementContext, CustomerSelfServiceContext, PolicyManagementContext, RiskManagementContext

  /* Add teams to this organizational map: */
  contains CustomersBackofficeTeam, CustomersFrontofficeTeam, ContractsTeam
  
  /* Define the subsystem/component relationships: */

  CustomerSelfServiceContext [D,C]<-[U,S] CustomerManagementContext

  PolicyManagementContext [D,CF]<-[U,OHS,PL] CustomerManagementContext
    
  PolicyManagementContext [P]<->[P] RiskManagementContext

  /* Define the team relationships: */
   
  CustomersBackofficeTeam [U,S]->[D,C] CustomersFrontofficeTeam
  
  CustomersBackofficeTeam [U]->[D] ContractsTeam
  
}

/* Team Definitions */
BoundedContext CustomersBackofficeTeam realizes CustomerManagementContext {
  type = TEAM
  domainVisionStatement = "This team is responsible for implementing the customers module in the back-office system."
}

BoundedContext CustomersFrontofficeTeam realizes CustomerSelfServiceContext {
  type = TEAM
  domainVisionStatement = "This team is responsible for implementing the front-office application for the insurance customers."
}

BoundedContext ContractsTeam realizes PolicyManagementContext, RiskManagementContext {
  type = TEAM
  domainVisionStatement = "This team is responsible for implementing the contract-, policy-, and risk-management modules in the back-office system."
}

/* Subsystem/component definitions */
BoundedContext CustomerManagementContext
BoundedContext CustomerSelfServiceContext
BoundedContext PolicyManagementContext
BoundedContext RiskManagementContext

Depending on how you configure the the generator (clustering parameter), it will generate one of the following visualizations for you. Not clustered:

Team Map Example (Unclustered)

… or clustered:

Team Map Example (Clustered)

Generating Context Maps

The generators can be called from the context menus of the CML editors in VS Code or Eclipse. A documentation how to call the generators can also be found here.

Note: All generator outputs will be generated into the src-gen folder.

System Requirements for this Generator

The generator requires Graphviz to be installed on your system because it uses it behind the scenes:

  • Ensure Graphviz is installed on your machine.
  • Verify that the binaries of the Graphviz installation are part of your PATH environment variable and can be called from the command line, for instance by executing dot -V from the command line.
    • In Windows this is not the case after the installation of Graphviz. The default installation path is C:\Program Files (x86)\GraphvizX.XX, which means you have to add C:\Program Files (x86)\GraphvizX.XX\bin to your PATH variable.