Skip to content
CONTEXT MAPPER
  • Docs
  • Language Reference
  • Generators
  • News
  • Background
  • Get Involved
    Introduction
    • Welcome
    • Getting started
    • Create CML Project
    • Examples
    • Usage as Library
    • Frequently Asked Questions
    Language Reference (Core)
    • 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
    Analysis and Design Transformations
    • Rapid Object-oriented Analysis and Design
    • Story Splitting (PoC)
    • Stakeholder and Value Modelling Transformations
    Architectural Refactorings (ARs)
    • 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
    Value-Driven Analysis and Design
    • Value-Driven Analysis and Design (VDAD) Support
    Service Cutter
    • Context Map Suggestions with Service Cutter
    • Service Cutter Configuration File (.servicecutter.yml)
    Reverse Engineering
    • Context Map Discovery
    Generators
    • Generators Overview
    • Context Map Generator
    • PlantUML Generator
    • BPMN Sketch Miner Generator
    • MDSL (Micro-)Service Contracts Generator
    • Service Cutter Generators
    • Generic Generator (Templating)
    Tutorials
    • Model Event Storming Results in Context Mapper
    • Event Sourcing and CQRS Modeling in Context Mapper
    • Generate Microservices From Context Map Using JHipster
    • Systematic Service Decomposition with Context Mapper and Service Cutter
    • Validating the Implementation against the Model (with ArchUnit)
    IDE Plugins and Extensions
    • Visual Studio Code Extension
    • Online IDE (no longer supported)
    • Eclipse Plugin
    • Feature Support

    Generators Overview

    The Context Mapper generators provide transformations to derive graphical Context Maps, PlantUML diagrams, and Microservice Domain-Specific Langauge (MDSL) (micro-)service contracts from your CML context map. We also provide a generic, template-based generator based on Freemarker which allows to generate arbitrary textual files.

    Generators:

    • Graphical context maps
    • PlantUML diagrams
    • MDSL (micro-)service contracts
    • Generic, template-based textual generator (Freemarker Templating)

    Using the Generators

    Visual Studio Code

    The generators are implemented as commands in VS Code. You can find them in the context menu of the CML editor:

    Generators Context Menu in VS Code

    Alternatively you find them in the command palette (Ctrl+Shift+P):

    Generators in the VS Code Command Palette

    Eclipse

    The generators can be accessed through the Context Menu in the project explorer (right-click to *.cml file) or directly in the CML editor as the following screenshot shows:

    Generators Context Menu in Eclipse

    Note: In the CML editor, you can also access all generators with the keybinding Shift+Alt+G quickly.

    Graphical Context Maps

    The Context Map generator allows you to transform the CML Context Map into graphical representation inspired by the illustrations of Vernon and Brandolini. You can find out how to generate them here.

    A sample Context Map produced with our generator is: Insurance Company Example Context Map

    PlantUML Diagrams

    You can generate plantUML component diagrams out of CML context maps. Additionally, the transformation generates UML class diagrams for all bounded contexts. If the implemented subdomains contain entities, the generator produces class diagrams for these subdomains as well. This page describes how to generate them.

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

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

    MDSL (Micro-)Service Contracts

    With our MDSL generator you can generate (micro-)service contracts from your Context Maps (or, more precisely, from upstream bounded contexts that expose at least one aggregate that contains at least one operation in a service or entity). The resulting contracts illustrate how you can derive (micro-)services from strategic DDD context maps and provide assistance regarding how to implement your system as a (micro-)service-oriented architecture.

    This is an examplary MDSL service contract for our insurance example:

    // Generated from DDD Context Map 'Insurance-Example_Context-Map.cml' at 21.10.2019 17:48:52 CEST.
    API description CustomerManagementContextAPI
    usage context PUBLIC_API for BACKEND_INTEGRATION
    
    data type Address { "street":V<string>, "postalCode":V<int>, "city":V<string> }
    data type AddressId P
    data type changeCustomerParameter { "firstname":V<string>, "lastname":V<string> }
    
    endpoint type CustomersAggregate
      serves as INFORMATION_HOLDER_RESOURCE
      exposes
        operation createAddress
          with responsibility "Creates new address for customer"
          expecting
            payload Address
          delivering
            payload AddressId
        operation changeCustomer
          with responsibility "Changes existing customer address"
          expecting
            payload changeCustomerParameter
          delivering
            payload V<bool>
    
    // Generated from DDD upstream Bounded Context 'CustomerManagementContext' implementing OPEN_HOST_SERVICE (OHS) and PUBLISHED_LANGUAGE (PL).
    API provider CustomerManagementContextProvider
      // The customer management context is responsible for managing all the data of the insurance companies customers.
      offers CustomersAggregate
      at endpoint location "http://localhost:8001"
        via protocol "RESTfulHTTP"
    
    // Generated from DDD upstream Bounded Context 'CustomerManagementContext' implementing OPEN_HOST_SERVICE (OHS) and PUBLISHED_LANGUAGE (PL).
    API client PolicyManagementContextClient
      // This bounded context manages the contracts and policies of the customers.
      consumes CustomersAggregate
    API client CustomerSelfServiceContextClient
      // This context represents a web application which allows the customer to login and change basic data records like the address.
      consumes CustomersAggregate
    
    IPA
    

    Learn more about the MDSL generator here.

    Generic Textual Generator (Freemarker)

    The generic, template-based generator allows you to generate arbitrary text files from CML Context Maps. It uses Freemarker as its template engine and exposes the entire CML content as an object tree whose elements can be injected into the template.

    Learn more about this generator here.

    Improve this page on GitHub
    ← PreviousContext Map Discovery Next →Context Map Generator
    © 2026 Context Mapper contributors
    • GitHub
    • Get Involved
    • Background & Publications
    • RSS