DDD · Domain Driven Design

Domain Driven Design - Subdomains

In Domain Driven Design, a Bounded Context, which is “primarily a linguistic delimitation, that is to say that terms and sentences can mean different things, according to the context in which they are employed. This linguistic delimitation refers to ubiquitous language, which is another essential element in DDD.” (from domain driven design is always composed of one or more subdomains.

There are three types of subdomains - * Core * Supplementary * Generic

Each type of subdomain has different attributes and work requirements.

The easiest way to explain things is to create a working example to see what is meant by each term.

If we were talking about a burger shop, we can think of a number of subdomains, the food preparation, and the sales. There’s also the cleaning, and the physical shop itself.

Core subdomain

The core domain is the one that gets people wanting to do business with this company, the company’s point of difference, in this case, the burgers.

Whatever is done here impacts the whole business, and defines the business in the customers eyes. The choice here might be to make the burgers quickly and efficiently, meaning the customer is never waiting for long. Or the burgers might be premium, large sized with gourmet ingredients.

This domain will change often, as the company seeks to keep, or extend, its competitive advantage, and is the focus of the business.

Supplementary subdomain

The sales subdomain, which is itself a supplementary subdomain, is further broken down, there’s a counter with face to face staff, a drive through, and a delivery service.

The face to face and drive through, our business has no real choice but to implement them themselves, but they’re not core domains. They aren’t the reason people want to buy the burgers. They supplement the core business. The company must do the jobs to do business, but they’re not necessarily the defining reason for people showing up. They also cannot be implemented by some third party,

Generic subdomain

The delivery, though, is a generic subdomain, because that’s been outsourced to a company that does food delivery for a number of businesses. It supplements the core business, but can be done using off the shelf solutions that anybody else can also buy. In this case many other competing businesses are doing the same thing using the same food delivery company.

Change

The above is a snapshot in time, there is no rule that any subdomain will stay core, supplementary, or generic in the future.

The core subdomain can easily change. For example if, say, the restaurant finds that the real reason people do business with them is the play ground aimed at children. The buildings become a core subdomain, and the burgers themselves become supplementary, or even generic if the business finds it’s better to buy in foods from other restaurants.

The supplementary subdomain also changed in that example, to a core subdomain. But they could also become generic, for example if the burger shop finds that having a shop to sell in does not make sense, they could, instead, supply to a supermarket, or other burger shops.

And, generic subdomains can change too, the delivery method could become a supplementary domain if the shop decided people who deliver the burger shops burgers should wear branded clothing, meaning that it has a dedicated team of delivery people. It could also become a core business, if its delivery team became the delivery people for multiple other shops.

Summary

Subdomains are a part of the Domain Driven Design approach, identifying their type allows the designer to make informed decisions on how to implement a solution for them. A core subdomain is going to be fast moving, central hub to the business, and should be treated as such. A supplementary subdomain is slower moving, but still important part of the business. And a generic subdomain is something already solved, and offers little to no competitive advantage.

Further, there’s nothing stopping subdomains from changing, businesses evolve, change is inevitable.

Knowing this empowers design.

Published:
comments powered by Disqus