Skip to the content.

16. Adopting Domain-Driven Design (DDD) and Clean Architecture Principles

Date: 2024-02-08

Status

Accepted

Context

Our goal is to implement robust and scalable solutions from the first attempt, overcoming the complexities and collaboration challenges inherent in software development. Recognizing the need for a unified approach to our software’s business domain and architecture, we see Domain-Driven Design (DDD) as a pathway to improved domain modeling and inter-team communication. Simultaneously, Clean Architecture principles, as proposed by Robert C. Martin, offer a blueprint for creating a decoupled, maintainable, and adaptable system. This strategic combination is anticipated to directly address our project’s needs, setting a strong foundation for future development.

Decision

To comprehensively address the identified challenges, we have decided to integrate both Domain-Driven Design (DDD) and Clean Architecture principles into our development and architectural practices. This encompasses:

1. Adopting Domain-Driven Design (DDD) Principles:

To improve communication and collaboration across teams and to more closely align our software design with the business domain.

1.1 Use Rich Domain Models:
1.2. Value Objects:

Value objects are only private setters and public getters.

2. Incorporating Clean Architecture Principles: Structuring our system to ensure:

Consequences

What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.

References