Although most developers have heard about Domain Driven Design, most applications I encounter today are the traditional ‘layered cake’ with an anemic domain model.
I have to admit that even a lot of applications I’ve helped building the last years are still using this approach. Why? 2 reasons;
- Lack of DDD knowledge in the teams. Most developers ‘know’ the tactical DDD patterns but are not aware of the strategic DDD patterns. What makes it even worse is that even the tactical patterns like the repository pattern are wrongly applied. Getting a team up to speed with DDD takes time, time that we unfortunately not always have in ‘fixed price, fixed time, fixed scope’ projects. Another reason to go for the ‘product not project’ approach.
- Lack of access to Domain experts. Good domain modelling can only work if the necessary expertise is around to help you find the correct ubiquitous language, identify bounded contexts and create a shared understanding of the business. Too much organizations are still siloed where a developer can talk to a functional analyst, a functional analyst can talk to a business analyst, a business analyst can talk to the business(and in fact not even the real user but someone who was assigned as a representative). It’s one of the reasons I like BDD and ‘the 3 amigos’ as it helps to close the gap.
Enough excuses… How does a well designed DDD project looks like? There are not a lot of good examples out there.
One example I can recommend that can help you get started is this one: https://github.com/asc-lab/better-code-with-ddd. It created the same application once using the traditional layered approach and once using DDD. Also take a look at the article; https://altkomsoftware.pl/en/blog/create-better-code-using-domain-driven-design/.