16 Nov 2023
Context mapping is a strategic modeling tool used in Domain-Driven Design (DDD) to visualize and understand the relationships between bounded contexts within a software system. It helps to identify and clarify the boundaries between different areas of domain knowledge, fostering a common understanding among domain experts, developers, and stakeholders.
Purpose of Context Mapping
Context mapping serves several key purposes in DDD:
-
Identifying Bounded Contexts: It helps to identify and delineate bounded contexts, which are self-contained units of domain knowledge with explicit boundaries.
-
Understanding Relationships: It visualizes the relationships between bounded contexts, revealing how they interact and exchange information.
-
Clarifying Ubiquitous Language: It promotes the development of a consistent ubiquitous language by identifying shared and distinct terms across contexts.
-
Guiding Integration Design: It informs the design of integration patterns between bounded contexts, ensuring seamless communication and collaboration.
Creating a Context Map
A context map is typically created collaboratively by domain experts, architects, and developers. It involves the following steps:
-
Identify Bounded Contexts: Start by identifying the key bounded contexts in the system based on domain knowledge and business requirements.
-
Represent Bounded Contexts: Represent each bounded context as a distinct shape or box on the map, labeled with its name and core domain concepts.
-
Define Relationships: Identify the relationships between bounded contexts, such as collaboration, dependency, or ownership.
-
Draw Communication Flows: Represent communication flows between contexts using arrows, indicating the direction and type of information exchange.
-
Label Flows with Roles: Label each communication flow with the roles involved, such as publisher, subscriber, or consumer.
-
Annotate with Details: Add notes and annotations to clarify specific aspects of the relationships and interactions.