DDD: Problem Space vs Solution Space

The difference between a bounded context and a subdomain in DDD has always been a bit fuzzy for me.

I've always looked at those overlapping maps in the books and not really gotten it. For the most part, I've just hoped that a subdomain just maps to a bounded context.

That's one state, but not the only one. I got curious (by necessity given what I am building :-) and got a good explanation out of google search(1).

The subdomain represents the business problem space. When you break down a company's business, you get the model of how the business operates.

In telco, it breaks down into Learn, Buy, Get, Use, Pay, Support. This is the business of running a cell provider. These are large domains which will get broken down into subdomains like, catalog, inventory, billing statements, cart, provisioning, etc.

These are the problems that need to be solved in order to make the business work. Bounded contexts are how you map the business problem space into the software solution space.

Maybe your business space is simple enough to have a catalog bounded context for the catalog subdomain. Or maybe it maps into more discrete things like the checkout subdomain having contexts for address verification and payment.

What matters inside of a bounded context is that it is a "boundary" around a domain model (the objects and rules, etc relating the software to the business problem) with a ubiquitous language that is consistent everywhere within the boundary.

With that boundary defined, you can start the work of building software to fit the business problem..

Without that boundary, you get the chaos of the monolith.

(1) gemini is suprisingly capable in the search chat

Next
Next

Spec-driven development is great, but finding the balance is important.