Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DDD - What is a complex domain?

It is often said that DDD (Domain-driven Design) is better suited for complex domains instead of simpler ones.

What characterizes a complex domain? (please be more specific than "it has complex business rules");

Which are examples of complex domains?

How can I classify a domain as complex (i.e. suitable for DDD) or not?

like image 740
Piovezan Avatar asked Jan 19 '16 11:01

Piovezan


People also ask

What is domain in DDD principle?

Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.

What is meant by domain-driven design?

Domain-driven design (DDD) is a software development philosophy centered around the domain, or sphere of knowledge, of those that use it. The approach enables the development of software that is focused on the complex requirements of those that need it and doesn't waste effort on anything unneeded.

What is domain and subdomain in DDD?

DDD refers to the application's problem space - the business - as the domain. A domain is consists of multiple subdomains. Each subdomain corresponds to a different part of the business. Subdomains can be classified as follows: Core - key differentiator for the business and the most valuable part of the application.

What are domain entities?

Entities are Domain concepts that have a unique identity in the problem domain. Entities represent domain objects and are primarily defined by their identity, continuity, and persistence over time, and not only by the attributes that comprise them.


1 Answers

From my experience 3 most important thing that makes your domain complex:

Size

Big domains tends to increase complexity. Handling and coordinate a lot of things is always hard.

Rules and invariants

Domains (even domains with just a couple of bounded context) might have a lot of domain rules and invariants and/or a lot of nuances in its use cases and process. This increase complexity. Rules that spam a lot of changes in a entity or inter-domains events are often the complex business rules.

Context

Context complexity is hard to explain wihtout a example. Let's put in the table a context complexity related to a entity named Product.

Depending of context; a entity could means different things in your domain. A Product entity doesn't means the same for Factory context, Marketing context, Sales context, PostSales support context, etc.

If the data, user cases, process, behaviour, etc related to Product entity, in every context, are very different the complexity increase a lot even when you just have a handful of context and entities. This usually means that you have many Product entities (one in every context) even if all of them are supported by the same persistence store (in case of ER store, the same table/s).

like image 107
jlvaquero Avatar answered Oct 05 '22 07:10

jlvaquero