In this series, I explain how I apply Domain-driven Design (DDD) in Go projects. This is not meant to be a definitive guide on how this should be done. Instead, I want to show you how it can be done. These are the methods I have come to apply frequently, after trying out many different ways, and they work quite well for me. But I’m still fine-tuning these methods frequently. Hopefully you’ll be able to extract some inspiration and teachings from them.

Some of the methods I describe deviate from what is commonly regarded as the ‘proper’ way of implementing DDD. When this happens, I will always try to explain why. It’s my personal opinion that DDD should be treated as a toolbox from which to select a subset of tools to use. I feel being dogmatic is almost never a good idea. The ‘right’ way of doing things almost always depends on the context in which it’s applied. Instead, I advocate for extracting learnings from DDD’s teachings and applying those learnings in a way that best fits the situation.

These methods may be incomplete. I might have overlooked something. Or they may not work very well for your specific problem domain. When that’s the case, I’d love to learn from you! So please leave your comments or questions under the posts.

Domain-driven Design in Go: Value Objects

Domain-driven Design in Go: Value Objects

In an ideal world non-technical colleagues could read code and quickly recognize the concepts, rules, and processes that make up the business. Such an ideal might prove unreachable but I’d argue it’s worth striving for nonetheless. Value Objects offer one way of getting closer to that ideal.
Dennis Vis
Dennis Vis
May 4 2023
10 min read
Domain-driven Design in Go: Entities

Domain-driven Design in Go: Entities

Where Value Objects represent pieces of immutable data without an identity, entities represent identifiable elements within our systems. Entities generally have a lifecycle. They can be created, oftentimes deleted and are expected to be mutated during their lifespan.
Dennis Vis
Dennis Vis
May 8 2023
9 min read
Domain-driven Design in Go: Aggregates

Domain-driven Design in Go: Aggregates

Using Value Objects and Entities goes a long way towards improving code readability and structure. But for effective system design in Domain-driven Design, you’ll need to understand a higher level building block: aggregates. In this post, I’ll explore what aggregates entail, how they relate to system design and how to create them in Go.
Dennis Vis
Dennis Vis
March 23 2025
12 min read