DSL Examples
This project contains example DDD Context Maps written in the ContextMapper DSL. The examples are provided for two different types of users. The simpler business analysis examples should be easy to understand for business analysts without technical background, while the detailed examples are meant for software architects and/or engineers.
Find out more about our DSL and tools on our website https://contextmapper.org/ and papers published by OST (former HSR).
Start exploring the examples in the Context Mapper online IDE right now:
IDE Requirements
This is a Gradle project and can easily be imported into any IDE (ideally VS Code or Eclipse with Context Mapper installed) that supports Gradle.
Context Mapper
In order to have language support for editing the CML files (Context Mapper Language), you need to install ContextMapper in Eclipse, Visual Studio Code, or use the online IDE Gitpod:
- Context Mapper for VS Code (Marketplace)
- Context Mapper for Eclipse (Marketplace)
- Alternatively use this Eclipse update site URL for manual installation:
https://dl.bintray.com/contextmapper/context-mapping-dsl/updates/
- Alternatively use this Eclipse update site URL for manual installation:
- VS Code Extension in Open VSX
- Can be found easily in your Gitpod's.
- Or: Start right now by using our demo repository.
The examples:
The following graphical illustrations of the context maps are inspired by Vernon and Brandolini. Once you modelled your context map in CML you can generate such graphical representations.
- Insurance Example
- Lakeside Mutual
- Context Mapper Example
- DDD Cargo Sample
- Architectural Refactoring (AR) Examples
Insurance Example
In the folder src/main/cml/insurance-example you find example context maps for a fictitious insurance company, inspired by Lakeside Mutual.
Context Map
The insurance example contains an example for a classic DDD context map written in the ContextMapper DSL (CML).
Team Map
It further contains a team map, illustrating the teams and their relationships. Additionally, CML allows to define which bounded contexts are implemented by which teams.
Lakeside Mutual
The Lakeside Mutual microservice project is another fictitious insurance application that demonstrates microservices and the application of Microservice API Patterns (MAP).
We reverse engineered the initial CML model of the project by using our discovery library. In addition we conducted an Event Storming (tutorial coming soon) for a future claim processing feature and modeled the results in the CML model. The model and the Event Storming result can be found in the following folder: src/main/cml/lakeside-mutual
The following graphical Context Map of the model has been generated with our Context Map generator:
Context Mapper Example
In the folder src/main/cml/context-mapper-example we modelled our own tool and framework with CML. The following context map illustration of our bounded contexts and framework components is generated out of the CML model with the Context Map generator:
DDD Cargo Sample
The folder src/main/cml/ddd-sample contains a context map based on the DDD sample from Eric Evans DDD book.
To make the sample interesting for our context mapping language, we splitted the Cargo application into three bounded contexts.
Architectural Refactoring (AR) Examples
The Context Mapper tool provides several Architectural Refactorings which can be applied to your models. A documentation of all available refactorings can be found under https://contextmapper.org/docs/architectural-refactorings. The folder src/main/cml/architectural-refactorings contains example CML models (input and ouput) to illustrate the architectural refactorings purposes.
Contributing
Contribution is always welcome! Here are some ways how you can contribute:
- Create Github issues if you find bugs or just want to give suggestions for improvements.
- This is an open source project: if you want to code, create pull requests from forks of this repository. Please refer to a Github issue if you contribute this way.
- If you want to contribute to our documentation and user guides on our website https://contextmapper.org/, create pull requests from forks of the corresponding page repo https://github.com/ContextMapper/contextmapper.github.io or create issues there.
Licence
ContextMapper is released under the Apache License, Version 2.0.