Are subdomains Identified? No

DDD practices require the domain and technical experts working together in order to identify the subdomains but sometimes is difficult when there’s a lack of knowledge in the business rules.

The domain-driven architectures require a deep knowledge of the subdomains for implementing them, otherwise, a wrong abstraction on the architecture makes more difficult to evolve it.

duplication is far cheaper than the wrong abstraction — Sandi Metz

Then the no-domain architectures are the best option when the lack of knowledge in the domain is high.

Is a legacy project?

The architecture decisions also depend on the project state.

For greenfield projects, we should implement a simple architecture focused on the project scope and avoid making it more complex based on assumptions or premature optimizations.

premature optimization is the root of all evil (or at least most of it) in programming — Donald Knuth

For brownfield (legacy) projects, On the development cycle, the architecture is iterated for solving the technical debt and speeding up delivery. On the project cycles, the architecture is iterated based on the requirements changes because at this time is when project scope changes, therefore the architecture should evolve along with the project.

The architecture should evolve along with the project.

Release and Project Iteration

Time after the project is released we can make a business analysis for iterating the project based on the information gathered from the user behaviours by using analytics tools. As you can notice the business analysis for a brownfield project unlike a greenfield is driven by the market needs in addition to the user needs.

When the next project iteration starts we have more information which helps the domain and technical experts to identify or iterate the subdomains using DDD pratices.

Are subdomains Identified? Yes

Once all or at least one subdomain is identified we can go for a domain-driven architecture.

Identifying subdomains for greenfield projects is not common but is possible when people involved in the project have a bunch of experience solving problems from that particular business domain.

Some domain-driven architectures such as micro-services are more complex to implement than others, therefore they require more technical expertise for implementing them.

Some domain-driven architectures require technical expertise for implementing them.

Strangler Pattern

A strangler pattern is an approach to steadily migrate a legacy project, unlike a big bang approach where the legacy system is drop out and a new one is developed from scratch.

This approach consists of removing the identified domains from the legacy system and decouple them on infrastructure or code level.

Note: Sometimes is better to go for a big bang approach when the application is small or when the project scope change dramatically.

Release and continue iterating

Finally, we need to release the architecture changes again so it’s time to iterate the project and the architecture again.

Conclusion

As software architects, we should avoid making decisions driven by assumptions, instead, we should take advantage of the learning cycle of each project iteration for making decisions driven by the project scope and the gathered knowledge.

Resources

Building Evolutionary Architectures

DDD 101 — The 5-Minute Tour

I think…I thought…what was I thinking? — Assumptions that drive decision-making