Author: Petter Holmström
This is the third part of our in-depth series on Domain-Driven Design (DDD). Part one discussed strategic domain-driven design, and part two discussed tactical domain-driven design. Updated for 2024.
In this article, we'll take a look at how to turn a domain model into working software - specifically, how to use the hexagonal architecture. The previous two articles were pretty generic, even though the code examples were written in Java. Although a lot of the theory in this article can also be applied in other environments and languages as well, I have explicitly written it with Java and Vaadin in mind.
Again, the content is based on the books Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans and Implementing Domain-Driven Design by Vaughn Vernon. I highly recommend you read both of them. However, even though I presented my thoughts, ideas, and experiences in the previous articles, this one is even more strongly colored by my thoughts and beliefs. That said, the books of Evans and Vernon got me started with DDD in the first place, and I’d like to think that what I’m writing here is not too far from what you will find in the books.
This is the second version of this article. In the first one, I got the concept of ports wrong. This was pointed out in a comment by a reader, which I am very grateful for. I have now corrected this error and updated the examples and diagrams accordingly. Comments about my interpretations of this architectural style and DDD are always welcome.