However, the identification of suited Bounded
Contexts is still challenging. This is where Con-
text Map models and diagrams, context mapping as a
practice and the strategic DDD patterns to define the
relationships between Bounded Contexts come into
play. From our experience, a clear understanding of
how these patterns shall work together is often miss-
ing, and different stakeholders have different opinions
on how these patterns should be applied and com-
bined. From these observations we derived our first
hypothesis:
Software engineers and service designers benefit
from clarification and advice on how to combine the
strategic DDD patterns in Context Maps.
We further believe that Context Maps are artifacts
which evolve iteratively. Software engineers can use
them to analyze and understand a domain. They can
also serve as an instrument to describe and communi-
cate the architecture of a system. However, it is also
beneficial if models can be transformed seamlessly
in order to improve the architecture in an agile way
or to generate other representations upon demand. A
machine-readable definition of a model offers the pos-
sibility to automate certain steps, for instance to gen-
erate abstract or concrete service contracts. This leads
us to our second hypothesis:
Adopters of DDD benefit from a tool which supports
the creation of DDD pattern-based models in a
rigorous and expressive way. They want to refactor,
transform and evolve such models iteratively.
In this paper, we present a Domain-specific Lan-
guage (DSL) for the strategic DDD patterns and as
another contribution, we distill a meta-model provid-
ing a concise interpretation of these patterns and their
applicability. The DSL is implemented in Context
Mapper. Domain-driven designs modelled in our tool
can be used to identify services with reasonable cohe-
sion and coupling. Our DSL also supports the refine-
ment of Bounded Contexts with tactic DDD patterns
as supported in the Sculptor DSL
1
. Generator tools
producing graphical Context Maps, PlantUML
2
dia-
grams, and (micro-) service contracts illustrate how
the language can be used to transform the Context
Maps into other representations. This paper focuses
on the DSL and addresses the second hypothesis only
partially. All other parts of our framework are docu-
mented online
3
and will be elaborated upon in future
work.
1
http://sculptorgenerator.org/
2
http://plantuml.com/
3
https://contextmapper.org/
The remainder of the paper is structured as fol-
lows. In Section 2 we present our first research con-
tribution, a strategic DDD meta-model with seman-
tic rules that describe our interpretation of the pat-
terns. Section 3 introduces the DSL syntax. Section 4
discusses usage scenarios and the applicability of the
presented approach. Section 5 concludes and outlines
future work.
2 DOMAIN-DRIVEN DESIGN
(DDD) ESSENTIALS/ANALYSIS
Since Evans has published his original DDD book
(Evans, 2003), other – mostly gray – literature on this
topic has been published. Our analysis and interpre-
tation of the patterns is based on the books of Evans
(Evans, 2003) and Vernon (Vernon, 2013). Our per-
sonal professional experience (Kapferer, 2017) has in-
fluenced the meta-model as well. Additional patterns
of Evans’ DDD reference (Evans, 2015), which has
been published a fews years after his first book, were
also considered. We further studied publications of
context mapping experts such as Brandolini (Bran-
dolini, 2009) and Pl
¨
od (Pl
¨
od, 2018; Pl
¨
od, 2019).
2.1 Example
Strategic Domain-driven Design (DDD) can be used
to decompose the problem domain of a software
system into multiple sub-domains and the so-called
Bounded Contexts. It also allows architects to define
the relationships between Bounded Contexts, e.g.,
how they work together. To explain pattern concepts
(and also, in Section 3, the DSL syntax) we use a
fictitious insurance software scenario. Figure 1 illus-
trates the Context Map of the scenario inspired by the
visualizations of Vernon (Vernon, 2013), Brandolini
(Brandolini, 2009) and Pl
¨
od (Pl
¨
od, 2018).
A Bounded Context defines an explicit boundary
within which a particular domain model, implement-
ing parts of sub-domains, applies. This boundary af-
fects team organization as well as physical manifesta-
tions such as code bases and database schemata. The
internal design of a Bounded Context is specified with
the tactic DDD patterns, including the Aggregate pat-
tern. An Aggregate is a cluster of domain objects
(such as Entities that have identifiers and lifecycles,
Value Objects that are stateless and immutable, and
Services) which is kept consistent with respect to spe-
cific invariants and typically also represents a unit
of work regarding system (database) transactions. A
Context Map provides a global view over all Bounded
Contexts related to the one a team is working on.
MODELSWARD 2020 - 8th International Conference on Model-Driven Engineering and Software Development
300