DDD Concepts, Code and Q&A
Domain-driven design (DDD) is a concept of modeling the application in turn of the business model. It promotes the division of responsibilities by layer, aligned to the business problems.
There are two important topics here to retain:
- DDD is not an architecture model;
- It should be applied only if you are creating an application with complex business rules.
Keep it simple is the rule for everything, and in this case, it is the same. If you are creating a CRUD Api, probably you will not need it.
Layers in a Domain-Driven Design
When we are using DDD, we can use different architectures. Three-tier architecture or onion architecture for example. DDD is all about the domain, not layers.
The layers exist to help developers manage the complexity in the code, it’s not related to the deployment of the service. The layers are only a logical artifact. Depending on the business and technical complexity it can be defined by multiple layers, different architectures.
DDD Concepts
- Context is a natural division within the business, something like: in a warehouse the context is shipping but in a store the context is sales. We may be talking about the same products but with different…