design-practice-repository

Summaries of artifacts, templates, practices, and techniques for agile architecting (DPR-mm) and service design (SDPR-nn).

DPR Git Pages HomeArtifacts Index

Artifact/Template: DDD Context Map

In domain-driven design, a context map shows bounded contexts (model boundaries, of different types) and their relations (e.g., influence flows).

Motivation (Addressed Information Need)

A context map visualizes the relationships between Bounded Contexts in Strategic DDD. Several types of such relationships have been described as patterns; Bounded Contexts abstract from functional feature sets, existing or future application, systems, and teams.

Usage (Produced and Consumed When)

The different types of map correspond to the following activities:

See activity description for Strategic DDD for more context and usage information.

Template Structure

DDD as such does not mandate any notation. Each author and presenter has his/her own style. The following visualization of context maps has become quite popular:

Sample Context Map (Source: Cargo Case Study)

Strategic DDD models influence and data flows, following a stream or river metaphor. The upstream U provides information or services consumed by the downstream D. The DDD relationship types either pertain to the relation itself and or its upstream and downstream ends.

Example(s)

The above context map was generated from this DSL model (Context Mapper):

ContextMap DDDSampleMap {
	contains CargoBookingContext
	contains VoyagePlanningContext
	contains LocationContext
	
	CargoBookingContext [SK]<->[SK] VoyagePlanningContext
	CargoBookingContext [D]<-[U,OHS,PL] LocationContext

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

SK indicates a Shared Kernel relationship. OHS stands for Open Host Service, PL for Published Language. See activity description for Strategic DDD for pattern descriptions.

Tools

Both informal, ad hoc modeling and somewhat more diligent approaches are supported:

Hints and Pitfalls to Avoid

Origins and Signs of Use

See activity description of Strategic DDD.

More Information

“Strategic Domain Driven Design with Context Mapping” by Alberto Brandolini introduces context maps by scenario and example.

Context Maps are covered in depth in the book “Implementing Domain-Driven Design” by Vaughn Vernon (@Vernon:2013).

The language reference of the Context Mapper DSL can be found here and this conference presentation gives an overview.

The Feature, Application, System, Team (FAST) taxonomy is introduced in “Domain-driven Architecture Modeling and Rapid Prototyping with Context Mapper,” by Stefan Kapferer and Olaf Zimmermann.

Data Provenance

title: "Design Practice Repository (DPR): Context Map (Strategic DDD)"
author: Olaf Zimmermann (ZIO)
date: "03, 30, 2021"
copyright: Olaf Zimmermann, 2020-2021 (unless noted otherwise). All rights reserved.
license: Creative Commons Attribution 4.0 International License