Ompluscator's Blog
  • Home
  • All Articles
  • Golang
  • Tools

architecture

September 17, 2023

Practical DDD in Golang: Domain Event

The tale of DDD in Go advances by introducing a fundamental building block that mirrors real-world events — the Domain Event.

In many cases, Entities are the most effective means of representing elements in Domain-Driven Design. Together with Value Objects, they can provide a precise reflection of our Problem Domain. However, sometimes, the most apt way to depict a Problem Domain is by employing events that transpire within it. In my experience, I increasingly attempt to identify events and then discern the Entities associated with them. Although Eric Evans didn’t cover the Domain Event pattern in the first edition of his book, today, it’s challenging to fully develop the domain layer without incorporating events.
September 17, 2023

Practical DDD in Golang: Domain Service

The story of DDD in Go continues by introducing one of the stateless building blocks - the Domain Service.

After discussing Entity and Value Objects, I will now introduce the third member of the group of Domain-Modeling patterns in this article: Domain Service. Domain Service is perhaps the most misunderstood DDD pattern, with confusion stemming from various web frameworks. In many frameworks, a Service takes on a multitude of roles. It’s responsible for managing business logic, creating UI components such as form fields, handling sessions and HTTP requests, and sometimes even serving as a catch-all “utils” class or housing code that could belong to the simplest Value Object.
September 17, 2023

Practical DDD in Golang: Entity

The story about DDD in Go continues by introducing one of the most common building blocks — the Entity.

In the previous article, I attempted to provide insights into the Value Object design pattern and how we should apply it in Go. In this article, the narrative continues with the introduction of a design pattern called Entity. Many developers have heard about Entity countless times, even if they’ve never used the DDD approach. Examples can be found in PHP frameworks and Java. However, its role in DDD differs from its use elsewhere.
🍺 Support my Blogging work

Join the Ompluscator's Blog Community

Hey there! Want to be part of our awesome community? Just drop your email below, and we'll send you the good stuff – cool articles, fun updates, and more. No spam, we promise!

Thank you for subscribing!

September 16, 2023

Practical DDD in Golang: Value Object

Let's begin a practical journey into Domain-Driven Design in Golang, starting with the most important pattern: Value Objects.

Saying that a particular pattern is the most important might seem like an exaggeration, but I wouldn’t even argue against it. The first time I encountered the concept of a Value Object was in Martin Fowler’s book. At that time, it seemed quite simple and not very interesting. The next time I read about it was in Eric Evans’ “The Big Blue Book.” At that point, the pattern started to make more and more sense, and soon enough, I couldn’t imagine writing my code without incorporating Value Objects extensively.
  • ««
  • «
  • 1
  • 2
  • »
  • »»
© Ompluscator's Blog 2024
  • Cookie Policy
  • Privacy Policy
  • Terms and Conditions
  • Consent Preferences

${title}

${content}