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
27
votes
6 answers

Concrete examples on why the 'Anemic Domain Model' is considered an anti-pattern

I apologize if this is a duplicate, but I couldn't find any concrete examples on the topic in related questions. After reading Martin Fowler's article on the 'Anemic Domain Model', I'm left wandering as to why is this considered an anti-pattern.…
27
votes
4 answers

Domain Objects and Services

In this question someone replies "You never let the domain object implementations call services by themselves!". Is this statement a hard fast rule of DDD or does it depend on your own application and architecture? Contrived example: As an example…
Todd Smith
  • 17,084
  • 11
  • 59
  • 78
27
votes
3 answers

Why does the entity framework need an ICollection for lazy loading?

I want to write a rich domain class such as public class Product { public IEnumerable Photos {get; private set;} public void AddPhoto(){...} public void RemovePhoto(){...} } But the entity framework (V4 code first…
Akk
27
votes
3 answers

Domain Driven Design: How to access child of aggregate root

If I have an Order class an as aggregate root and 1000 line items. How do I load just one of the 1000 line items? As far as I understand, a line item can only be accessed through the Order class and has a "local" identity. Would I still create a…
Chris
  • 7,229
  • 7
  • 41
  • 57
27
votes
2 answers

DTO DAO POCO BO

Actually i'm pretty confused about this terms and how they relate to each other. A read something about every one of them but i don't uderstant the work flow.. DTO - Data transfer object - object to transport values BO Business object - object in…
user137348
  • 10,166
  • 18
  • 69
  • 89
26
votes
4 answers

DDD (Domain Driven Design), how to handle entity state changes, and encapsulate business rules that requires large amount of data to be processed

public class Person { public IList SpecialBirthPlaces; public static readonly DateTime ImportantDate; public String BirthPlace {get;set;} public DateTime BirthDate { set { if (BirthPlace!=null…
Alex Burtsev
  • 12,418
  • 8
  • 60
  • 87
26
votes
3 answers

Please clarify how create/update happens against child entities of an aggregate root

After much reading and thinking as I begin to get my head wrapped around DDD, I am a bit confused about the best practices for dealing with complex hierarchies under an aggregate root. I think this is a FAQ but after reading countless examples and…
christian
  • 261
  • 1
  • 3
  • 3
26
votes
6 answers

When to use domain driven development and database driven development?

Can anybody have good answer when should be database driven development be used and when should domain driven development be used. These both development approach have their importance in their respected areas. But I am not so clear which approach…
Prajwal Tuladhar
  • 543
  • 1
  • 5
  • 12
26
votes
2 answers

DDD Architecture - Where To Put Common Methods/Helpers

According to this question on Stack Overflow, in DDD architecture "helper" classes can be in different layers depending on their purpose. For example a helper that formats something in a user friendly way would go in the UI. A database helper would…
Louise Eggleton
  • 969
  • 2
  • 15
  • 27
26
votes
4 answers

Domain queries in CQRS

We are trying out CQRS. We have a validation situation where a CustomerService (domain service) needs to know whether or not a Customer exists. Customers are unique by their email address. Our Customer repository (a generic repository) only has…
JontyMC
  • 6,038
  • 6
  • 38
  • 39
26
votes
1 answer

Are snapshots supported in EventStoreDB?

I am seriously thinking of using EvenStore from Greg Young, for implementing a system based on events. However, I am not sure whether EventStore from Greg Young supports Snapshots. Snapshots are key requirement for my application as we do not want…
26
votes
3 answers

Avoid Unit of Work pattern in domain driven design

I have read this and it makes me think twice...: "Avoid unit of work pattern. Aggregate roots should define transaction boundaries." Why should someone avoid the UOW pattern applying domain driven design?
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
26
votes
3 answers

Rich Domain Model and ORM

Martin Fowler considers Anemic Domain Model as an anti-pattern. Rolling the Persistence Model as the Domain Model seems severely off too due to Object Relational Impedence Missmatch. For persistence and normalization sakes, we tend to break down…
Alwyn
  • 8,079
  • 12
  • 59
  • 107
26
votes
9 answers

Where can I find good Domain Driven Design resources?

What are the best places to find out everything there is to know about Domain-Driven Design, from beginner to advanced. Books Websites Mailing lists User groups Conferences etc
Stefan Moser
  • 6,663
  • 9
  • 35
  • 48
26
votes
4 answers

How does Domain Driven Design handle Reporting?

I found DDD being natural if I am working on a operational/transactional type of application. However I am always stucked in a reasonable way to handle reporting type of functions. The reporting I am talking on is not bound to report generation,…
Adrian Shum
  • 38,812
  • 10
  • 83
  • 131