Senior
What should the application control according to DDD?
sobes.tech AI
Answer from AI
According to Domain-Driven Design (DDD), the application should control the business logic and rules of the domain, not the technical implementation details.
Main aspects that the application controls in DDD:
- Aggregates and their invariants. The application ensures data integrity within aggregates, maintaining the correctness of their state.
- Business rules and processes. Logic reflecting real business processes is implemented in domain services and entities.
- Interaction between domain objects. The application manages relationships and behaviors of objects to reflect the domain.
Example: if you have an order management system, the application should ensure that an order cannot be paid twice, that the order status changes according to business rules, and that all operations meet domain requirements. Technical details such as data storage or communication are handled in the infrastructure layer.