DDD itself
It has been some time since I read
this fantastic book. As its title implies, the book is about Domain-Driven design. What is it?
Wikipedia states the following:
Domain-driven design (DDD) is an approach to develop software for complex needs by connecting the implementation to an evolving model. The premise of domain-driven design is the following:
- Placing the project's primary focus on the core domain and domain logic.
- Basing complex designs on a model of the domain.
- Initiating a creative collaboration between technical and domain
experts to iteratively refine a conceptual model that addresses
particular domain problems.
The definition above is long because it's hard to write a definition that will be short and formal at the same time. Moreover, this 'long and formal' definition does not really capture the ideas of DDD (at least as I see them):
- Developers should know and understand the concepts and ideas of business domain and base the design on the model of the domain. I mean, not only they should know about how invoices are handled in the app, but also understand the idea behind an invoice. That understanding is critical to creating designs that adhere to domain model, not fight the model.
- The domain language is really important in designing the application. Just consider the following sentences. 'We store legs of a journey in a table in the database' OR 'We persist itinerary information'. The second one will be better understood by a domain expert. He might even point out that we don't need to store the whole itinerary,
The lines above are probably no better than the formal definition, but they should give you the idea.
The book
The author talks a lot about ideas, pros and cons of DDD, refactorings that lead to more domain-oriented code. It also discusses several patterns of writing code that can be easily matched to corresponding domain ideas. For example,
Strategy Pattern (as well as most of the classic GoF patterns) are not about DDD, but about lower-level OOD, and
Specification Pattern is about real-world specifications transformed into code.
Thus the book covers all the levels of applying DDD: from strategic architecture decisions to writing code, it still tends to be more high-level — architecture and design get more attention than code. And I like this idea, because code may be relevant to many developers, but the ideas are relevant for everyone.
My impression
I really liked the book because it gave me several insights on system design and architecture, broadening the range of things I take into account when writing new products or redesigning the old ones. In the same time, on my level of expertise I might need a much shorter DDD intro book (like this one:
http://www.infoq.com/minibooks/domain-driven-design-quickly).
Would I recommend reading it? Definitely yes if you are interesting in software design. It won't make you a great software architect after you turn the last page, but it shows you the path.