design-practice-repository

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

DPR Git Pages HomeActivities Index

Activity/Technique: Strategic Domain-Driven Design (DDD)

Context

While Tactic DDD deals with implementing domain logic, Strategic DDD deals with integrating the resulting components. It attempts to manage complexity in end-to-end application landscapes, possibly over long periods of time. Small projects and businesses might not require such long-term perspective and coordination; software development projects and development organizations at large software-intensive firms usually do.

The interfaces between systems and teams have to be managed somehow, either centrally or decentrally. Enterprise architecture management frameworks such as TOGAF can be leveraged to do so; Scrum of Scrums and the portfolio level in the Scaled Agile Framework (SAFe) address related concerns. Strategic DDD provides patterns and a simple diagram type to either support or complement such efforts.

Goal and Purpose (When to Use and When not to Use)

As a domain-driven designer, I want to (de-)compose system landscape and team organization so that system parts can be developed, deployed, scaled, and changed independently.

According to Alberto Brandolini’s InfoQ article on strategic DDD that develops an example in several steps, there are four particular reasons to bother about model partitioning and model/context boundaries:

  1. “Same term, different meaning” (homonym)
  2. “Same concept, different use” (polyseme)
  3. “External system differences” (heterogeneity)
  4. “Scaling up the organization” (multiple teams)

Ambiguities that are not detected can cause misunderstandings between stakeholders and create project risk. For instance, different attributes and different relations between domain concepts around people may have to be analyzed, designed, and implemented. Differences between customers, business partners, and staff members do exist and probably matter, even if all three are human beings. And legal entities/persons might have similar but not the same properties (what would the body mass index of a company be?). Finding out about such domain facets when coding or, even worse, during integration or interoperability testing causes extra effort and other pain; strategic DDD can unveil such ambiguities early, and help manage them from then on.

Instructions (Synopsis, Definition)

The key pattern in strategic DDD is Bounded Context, an abstraction of a functional area (i.e., a set of related features targeting one or more stakeholder groups), system (from different viewpoints, for instance logical and physical), or team (or, more generally, an organizational unit):

The following domain model for Strategic DDD gives an overview of the patterns in it (as well as the connection to Tactic DDD via Aggregates):

Strategic DDD Concepts and their Relations

The original DDD book by Eric Evans defined an initial set of relations between Bounded Contexts appearing in a Context Map, e.g., the Conformist pattern (@Evans:2003). Later on, a few additional types were added. In “An Introduction to Domain Driven Design”, Dan Haywood summarizes the original six patterns as this:

The extensions are:

Note: These patterns describe organizational relationships, first and foremost (not technical ones).

Summaries of the patterns from the original DDD book as well as the extensions are available for free download in the book “Domain-Driven Design Reference”, also by Eric Evans.

While being organizational, the relationships can still serve as input for technical design work. They differ with respect to the following design concerns:

Strategic DDD identifies Bounded Contexts and then answers these questions to end up at the right pattern for any given relationship. Context Maps can drive the architectural decision making in API design. Follow-on decisions then pertain the integration style and technology.

Note that the relationship patterns do not exclude, but complement each other by default. Context Mapper is a tool that can help doing so; it features DDD patterns and enforces additional semantic validation rules that clarify which relationships and pattern combinations make sense.

The FAST taxonomy introduced in @Kapferer:2020a proposes a classification of Bounded Contexts into Feature, Application, System, and Team contexts.

Suggested Steps in Strategic DDD

Example(s)

The Context Mapper website provides a number of examples of DDD applied, including a model of a fictitious microservices ecosystem in the insurance domain:

Example Context Map: Lakeside Mutual Case Study

Benefits vs. Effort (Expected Benefits, Skill Levels)

An OOSPLA 2006 experience report makes the case for strategic DDD in an oil company. A second article from the same authors reports on usage of strategic DDD in enterprise architecture management.

Hints and Pitfalls to Avoid

Origins and Signs of Use

Strategic DDD was introduced in Eric Evans’ original DDD (@Evans:2003), but featured even more prominently later in “Implementing Domain-Driven Design” by Vaughn Vernon (@Vernon:2013).

Usage of the pattern names and presence of Context Maps, either drawn informally or modeled in a tool, indicate use.

Practices and Techniques (Refinements, Guides)

There is a GitHub organization called ddd-crew that features many business analysis-level extensions to DDD practices, for instance a Bounded Context Canvas template.

More Information

Refer to presentations, articles, and books by:

An “Introduction to Strategic DDD” is available on the Vaadin website.

Articles about Context Mapper and its interpretation of the DDD patterns can be found on the Context Mapper website, including “Domain-driven Architecture Modeling and Rapid Prototyping with Context Mapper” (@Kapferer:2020a) and “Domain-Driven Service Design — Context Modeling, Model Refactoring and Contract Generation” (@Kapferer:2020b). Experience with the tool on projects is shared in two blog posts “Domain-Driven Design in Practice — Experience with Context Mapper” (here and here).

Data Provenance

title: "Design Practice Repository (DPR): Practice/Technique Strategic DDD"
author: Olaf Zimmermann (ZIO)
date: "09, 02, 2024"
copyright: Olaf Zimmermann, 2020-2024 (unless noted otherwise). All rights reserved.
license: Creative Commons Attribution 4.0 International License