Questions tagged [domain-driven-design]

Domain-driven design (DDD) is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts. Note that conceptual DDD questions are better to be asked at softwareengineering.stackexchange.com.

The premise of domain-driven design is the following:

  • Placing the project's primary focus on the core domain and domain logic
  • Basing complex designs on a model
  • Initiating a creative collaboration between technical and domain experts to iteratively cut ever closer to the conceptual heart of the problem.

Domain-driven design is not a technology or a methodology. DDD provides a structure of practices and terminology for making design decisions that focus and accelerate software projects dealing with complicated domains.

The term was coined by Eric Evans in his book of the same title: Domain-Driven Design: Tackling Complexity in the Heart of Software

Books

Sample Application

6728 questions
31
votes
2 answers

When to use an Eventstore

I am not quite sure I understood what an Eventstore is, I thought of it as some kind of "Transactionlog" for Domainobjects. What are the advantages/disadvantages of it and what are good scenarios to use it and when shouldn't it be used? EDIT: Since…
Bernhard Kircher
  • 4,132
  • 3
  • 32
  • 38
31
votes
5 answers

Nestjs Dependency Injection and DDD / Clean Architecture

I'm experimenting with Nestjs by trying to implement a clean-architecture structure and I'd like to validate my solution because I'm not sure I understand the best way to do it. Please note that the example is almost pseudo-code and a lot of types…
31
votes
6 answers

How to avoid having very large objects with Domain Driven Design

We are following Domain Driven Design for the implementation of a large website. However by putting the behaviour on the domain objects we are ending up with some very large classes. For example on our WebsiteUser object, we have many many methods…
Pablojim
  • 8,542
  • 8
  • 45
  • 69
30
votes
1 answer

Where to implement Automapper in a DDD + layered architecture

Background: For my own clarity / self education, I am trying to implement a simple Order Entry application using TDD + DDD. My primary goal is to keep the architecture clean by separating concerns. I have four layers (for now) ...…
Bob Tabor
  • 967
  • 1
  • 13
  • 23
29
votes
4 answers

Is Unit Of Work and Repository Patterns very useful for big projects?

I'm starting a new web project using ASP.NET Webforms + EF4. I'm trying to apply a repository pattern with a unit of work pattern following this tutorial :…
mehmetserif
  • 1,185
  • 7
  • 26
  • 48
29
votes
3 answers

Aggregate Root references other aggregate roots

I'm currently working a lot with DDD, and I'm facing a problem when loading/operating on aggregate roots from other aggregate roots. For each aggregate root in my model, I also have a repository. The repository is responsible for handling…
29
votes
2 answers

Inter-Aggregate Communication in CQRS + DDD + Event Sourcing

How should separate aggregate roots (AR) communicate with one another in an environment built on DDD principles using an event-sourced aggregate back-end? For instance, I have a Facility aggregate root (AR) which has a factory method responsible for…
JD Courtoy
  • 2,855
  • 25
  • 27
29
votes
2 answers

DDD - How to implement high-performing repositories for searching

I have a question regarding DDD and the repository pattern. Say I have a Customer repository for the Customer aggregate root. The Get & Find methods return the fully populated aggregate, which includes objects like Address, etc. All good. But when…
29
votes
4 answers

Is the Controller in MVC considered an application service for DDD?

I am applying DDD for the M part of my MVC and after some research (studying up!), I have come to the realization that I need my controller to be interacting with domain services (in the model). This would make my controller the consumer of the…
Louis
  • 1,194
  • 1
  • 10
  • 15
28
votes
3 answers

Do we need to use the Repository pattern when working in ASP.NET MVC with ORM solutions?

I am bit curious as to what experience other developers have of applying the Repository pattern when programming in ASP.NET MVC with Entity Framework or NHibernate. It seems to me that this pattern is already implemented in the ORM themselves.…
Bikal Lem
  • 2,403
  • 18
  • 19
28
votes
4 answers

Functional way of implementing domain driven design

I've had a lot of experience with writing domain driven applications using C#. The more applications I write the more I find that I want to take an approach that doesn't fit that well with standard C#/OO techniques: I want to write as many pure…
Andrew Skirrow
  • 3,402
  • 18
  • 41
28
votes
2 answers

Product Versioning Microservices

I go into microservices architecture based on docker and I have 3 microservices, which together create one product for example "CRM system". Now I want my client to be able to upgrade his product, whenever he wants to. I have 3 different versions…
Dariss
  • 1,258
  • 1
  • 12
  • 27
28
votes
12 answers

Are there any open source projects using DDD (Domain Driven Design)?

I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#. Are…
Mikael Sundberg
  • 4,607
  • 4
  • 32
  • 36
28
votes
1 answer

Extensibiliy with DDD: Module Vs Bounded Context in DDD with MEF

Eric in his book touches the subject of Modules very little. He also does not talk about the relation of the structure of modules to bounded contexts with examples. Do Bounded Contexts contain modules or modules contain the Bounded Contexts? When an…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
27
votes
6 answers

Is using one-to-one interfaces with domain entities a good or bad practice? Why?

One thing I see in some DDD enterprise apps that I work on, is the use of interfaces that are identical to the domain entities, with a one-to-one mapping of properties and functions. Indeed a domain object is always used through it's one-to-one…
Mark Rogers
  • 96,497
  • 18
  • 85
  • 138