Bounded Context

Most applications enclose more than one #Domain Model in their implementation. A Bounded Context is a strategic pattern designed to isolate and protect a #Domain Model in a context while ensuring it can collaborate with other models. It is typically a technical solution to a clearly identified subdomain.

Bounded Contexts enclose the software implementation tackling a particular Problem, including architecture, source code, dependencies, and deployment scripts. They also contain code that supports integration with other Bounded Contexts.

A Bounded Context typically has these layers:

  • Input Adapters: UI, REST Endpoints, and Message Listeners

  • Application Services: Use Case Orchestration and Transaction Management

  • The #Domain Model

  • Output Adapters: Persistence, Message Dispatch

    The goal of DDD is to have one Bounded Context per Subdomain. In other words, a Bounded Context should address just one subdomain and one alone. When not possible, code structures (like Modules) separates the supporting domain from the Core domain.