Category Archives: DomainDrivenDesign

Dealing with Duplication in MediatR Handlers

We’ve been using MediatR (or some manifestation of it) for a number of years now, and one issue that comes up frequently is “how do I deal with duplication”. In a traditional DDD n-tier architecture, you had: Controller Service Repository … Continue reading 

Also posted in MediatR | 7 Comments

CQRS/MediatR implementation patterns

Early on in the CQRS/ES days, I saw a lot of questions on modeling problems with event sourcing. Specifically, trying to fit every square modeling problem into the round hole of event sourcing. This isn’t anything against event sourcing, but … Continue reading 

Also posted in CQRS, MediatR | 13 Comments

10 Lessons from a Long Running DDD Project – Part 2

In Part 1 of this 2-part series, I walked through some lessons learned from the first incarnation of our project. The original project I’d still qualify as a success, in that it was delivered on-time, within budget, and is still … Continue reading 

| 11 Comments

10 Lessons from a Long Running DDD Project – Part 1

Round about 7 years ago, I was part of a very large project which rooted its design and architecture around domain-driven design concepts. I’ve blogged a lot about that experience (and others), but one interesting aspect of the experience is … Continue reading 

| 9 Comments

What Microservices Is Not

From what the term “Service” does not imply, from “What is a service (2016 edition)”: “Cloud” “Server” “ESB” “API” XML JSON REST HTTP SOAP WSDL Swagger Docker Mesos Svc Fabric Zookeeper Kubernetes SQL NoSQL MQTT AMQP Scale Reliability “Stateless” “Stateful” … Continue reading 

Also posted in Microservices | 9 Comments

CQRS and REST: the perfect match

In many of my applications, the UI and API gravitate towards task-oriented UIs. Instead of “editing an invoice”, I “approve an invoice”, with specialized models, behaviors and screens just for accomplishing that task. But what happens when we move from … Continue reading 

Also posted in CQRS, Microservices, REST | 35 Comments

Validation inside or outside entities?

A common question I get asked, especially around a vertical slice architecture, is where does validation happen? If you’re doing DDD, you might want to put validation inside your entities. But personally, I’ve found that validation as part of an … Continue reading 

| 26 Comments

Tackling cross-cutting concerns with a mediator pipeline

Originally posted on the Skills Matter website In most of the projects I’ve worked on in the last several years, I’ve put in place a mediator to manage the delivery of messages to handlers. I’ve covered the motivation behind such … Continue reading 

Also posted in Architecture, Design | 71 Comments

A better domain events pattern

Domain events are one of the final patterns needed to create a fully encapsulated domain model – one that fully enforces a consistency boundary and invariants. The need for domain events comes from a desire to inject services into domain … Continue reading 

Also posted in EntityFramework | 101 Comments

Domain modeling with Entity Framework scorecard

A long, long time ago I had a series on strengthening your domain, highlighting how simple refactoring tools and code smells can help guide your models to push behavior down into your core domain model/business objects/whatever. All the techniques highlighted … Continue reading 

Also posted in EntityFramework, NHibernate | 27 Comments