Context Map Generator

Introduction

With our Context Map generator you can produce graphical representations of your Context Mapper DSL (CML) Context Maps. The visualization of the generated Context Maps is inspired by the illustrations of 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"
  }
}

For this Context Map our generator produces the following graphical result:

Insurance Company Example Context Map

User Guide

The Context Map generator can be used within our Eclipse plugin as described below.

System Requirements

The generator requires Graphviz to be installed on your system since it is based on it.

  • Ensure Graphviz is installed on your machine.
  • Ensure the binaries of the Graphviz installation are part of your PATH environment variable and can be called from the command line.
    • Especially on 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.

Generating Context Maps

The generator can be called from the Context Mapper context menu within the CML editor or on the corresponding CML file:

Context Map Generator Context Menu

A dialog will allow you to adjust the following parameters before the Context Map is generated:

  • Formats which shall be exported (PNG, SVG, DOT)
  • Size of the image (you can fix the width or height of the image)
  • Spacing factor (you can increase or decrease the spacing between edges, which can help to handle overlapping labels)

All the diagrams will be generated into the src-gen folder.