cult3

Implementing Domain Driven Design [Review]

Nov 05, 2014

Table of contents:

  1. The Blue Book is the theory
  2. The Red Book is the practical
  3. About the book
  4. Conclusion

Last week I wrote a review of Eric Evans’ Domain-driven Design: Tackling Complexity in the Heart of Software. Evans was the first person to coin the term Domain Driven Design and his book pioneered a new approach to application development.

“The Blue Book” (as it is informally known) was one of the first to put into words the collective experience of Object Orientated Programming that forms the theory of Domain Driven Design.

Implementing Domain Driven Design (informally known as “The Red Book”) builds upon the theory of the “The Blue Book” to show you how you can practically implement the tools and techniques of Domain Driven Design in real world projects.

Whilst “The Blue Book” was an incredibly thought provoking book, a lot of the tools and techniques were ideas captured in prose. “The Red Book” offers guidance over those tools and techniques and shows you how they can be applied. “The Red Book” also covers a lot of new Domain Driven Design related material that has surfaced since the first publishing of the “The Blue Book”.

Implementing Domain Driven Design is written by Vaughn Vernon, a highly regarded software engineer with more than twenty-five years of development experience. Vernon is a pioneer in the world of Domain Driven Design and simplifying the design of software applications.

The Blue Book is the theory

Domain Driven Design was a groundbreaking book and is still regarded as one of the most important books in software design and development.

For the first time many of the patterns and techniques of Object Orientated Programming were captured and explored as a way to teach others and to show how the real world could be effectively modelled in code.

The book also introduced the concept of the Ubiquitous Language and advocated the importance of communication and the relationship between the development team and the business experts of the organisation.

The Red Book is the practical

Implementing Domain Driven Design takes the theory of “The Blue Book” and shows you how to practically implement it in real world projects.

Throughout the book you follow a team of developers working on a number of interrelated projects. As the book progresses you follow the team’s thought processes and epiphanies as they discover how the theory of Domain Driven Design can be applied to the problems they face.

The book also contains a wealth of code examples showing you exactly how the theory could be implemented. The code examples are written in Java, however I think they are still understandable if you have experience with another Object Orientated language.

I think one of the best aspects of this book is the fact that you follow a team of developers as they are tasked with creating a series of new applications. At the start of each chapter the team is unsure how to tackle a specific problem and so they are forced to take a naive initial idea and iteratively discover the best solution.

In most cases this involves exploring the theory of Domain Driven Design bit-by-bit or drawing on related industry material to understand how the problem could be resolved.

This iterative approach not only gently introduces you to a lot of high-level patterns and techniques, it also gives you an inside look into the reasoning of how certain decisions are made and how the team got to that solution.

If you have read “The Blue Book” a lot of the material in Implementing Domain Driven Design will be familiar. The development team take a lot of the patterns and techniques and show how they can be applied in each of the applications they have been tasked to build.

Implementing Domain Driven Design also looks at a lot of new material that has come to prominence since “The Blue Book” was first published.

About the book

For me, Implementing Domain Driven Design was really the key to fully understanding a lot of the benefits of Domain Driven Design.

When reading “The Blue Book” I understood why a lot of the ideas made sense. However, I often find that theoretical solutions are easier to understand once you can see it working within the context of a real world application.

This book is full of code examples and it shows you how to implement a lot of the ideas of Domain Driven Design. As I mentioned earlier, the examples are in Java, but if you are experienced with PHP, I’m sure you won’t have trouble understanding the mechanics of how the code should work.

There are also a lot of practical examples of code that can be used in your projects. Unless you are a Java programmer, much of the code can be directly translated into your language of choice as a direct solution to many of the common problems of web application development.

The side benefit of all of these code examples is there is a lot of subtle guidance of Object Orientated best practices and how to think about structuring your code in non-trivial applications.

If I had a criticism of the book it would be that some of the code examples seem a bit too specific to the types of application the book is developing. At times I found myself reading 20 pages of code examples of stuff that I will probably never use.

Personally I found the more generic problems and solutions much more beneficial because it didn’t take much for me to imagine how I could use those building blocks to solve the problems that I’m currently facing.

Conclusion

I think “The Blue Book” and “The Red Book” really go hand-in-hand as the perfect introduction to the world of Domain Driven Design. Reading one after the other will allow you to connect the dots between the theory and the implementation of how to take these ideas and apply them in your day-to-day work.

Implementing Domain Driven Design is fantastic exploration of how to practically implement the ideas of Domain Driven Design.

I particularly enjoyed the approach of following a team of developers through the journey of building their applications and tackling the problems they faced. I found that this journey of discovering through each chapter was a really gentle approach to understanding the benefits of the solution, without just giving you the cookie-cutter answer.

You will also be able to take a lot of real-world implementation details away from this book and start using them in your projects. A lot of the development in the “Building Cribbb” series can be attributed to the teachings of this book.

I think if you are very new to the world of Object Orientated Programming and web application development in general, you might struggle with the tools and techniques of this book.

As I mentioned in my review of Domain Driven Design, if you don’t feel like you are ready to tackle this approach to application development just yet, don’t worry about it. Make a note of the title and come back to it when you feel like you have a better grasp of the fundamentals.

If you are a fairly experienced developer and you have a good grasp of Object Orientated Programming, I would highly recommend that you pick up both of these books and give them a read. I feel like I’ve opened up a whole new world of understanding since exploring Domain Driven Design.

Implementing Domain-Driven Design on Amazon (Affiliate link)

Philip Brown

@philipbrown

© Yellow Flag Ltd 2024.