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
4
votes
2 answers

Using summary objects with domain driven design

I am new at domain driven design. We are creating entity objects to represent our model. And Representing database tables with same schema. But I am a bit confused about summary objects. Product is an entity and database table. States is an entity…
barteloma
  • 6,403
  • 14
  • 79
  • 173
4
votes
2 answers

Domain Driven Design - Atomic transaction across multiple bounded context

In DDD, I understand that Events can decouple the Bounded Contexts when they communicate with each others. Assume an atomic transaction contains two database operations on seperated bounded contexts A and B. When operation on A finishes it sends…
Tyler Shao
  • 156
  • 1
  • 10
4
votes
1 answer

DDD Composing Multiple Bounded Contexts

I would like your advices about bounded contexts integration. I have a usecase which put me in a corner : I have a bounded context for Contract management. I can add parties (various external organizations for example) to a contract. Select for…
Archange
  • 397
  • 5
  • 21
4
votes
3 answers

DDD and Entity Framework, Filters

So I am struggling with the approach DDD has to follow when we talk about filtering and queries. From this SO question Is it okay to bypass the repository pattern for complex queries? I can see the filtering by User should be done after getting all…
4
votes
2 answers

Is Domain-Driven Design a right fit for a product in Enterprise Architecture Domain?

Our client has a requirement to re-design from scratch a product in an Enterprise Architecture Business Domain. The product has an ability to model business processes, information, technology, infrastructure, data etc. for the entire organization of…
Ajay Jadhav
  • 2,417
  • 4
  • 21
  • 26
4
votes
5 answers

Where should configuration be placed?

I have an application structured as follows: dao domain main services utils I've made a class that reads the application configuration from an XML file. The question is where should it be placed? By reflex, I'd have placed it in utilities but…
James P.
  • 19,313
  • 27
  • 97
  • 155
4
votes
4 answers

Where to put NHibernate query logic?

I am trying to set up proper domain architecture using Fluent NHibernate and Linq to NHibernate. I have my controllers calling my Repository classes, which do the NHibernate thang under the hood and pass back ICollections of data. This seems to…
Mike Cole
  • 14,474
  • 28
  • 114
  • 194
4
votes
3 answers

Should a Trim method generally in the Data Access Layer or with in the Domain Layer?

I'm dealing with a database that contains data with inconsistencies such as white leading and trailing white space. In general I see a lot of developers practice defensive coding by trimming almost all strings that come from the database that may…
4
votes
2 answers

General ORM design question

Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a…
Calvin
  • 41
  • 1
4
votes
3 answers

DDD and Entity Base, Model using multiple identity types

I have a model that looks like this: public interface IEntity { int Id { get; set; } } Then the idea is to have my entities inherit from this interface: public class User : IEntity { public int Id { get; set; } } However, one of my…
Thomas
  • 5,888
  • 7
  • 44
  • 83
4
votes
4 answers

Product class responsibilities

In my company we have a very specific pricing strategy: Every Product in our catalog has a baseUsdPrice, for example product Foo has base USD price of 9.99$. That does not necessary mean that will be your you'll be paying 9.99$. We check your…
acid
  • 2,099
  • 4
  • 28
  • 41
4
votes
3 answers

Massive data operations in the stored proc to DDD

Lets take an example of a product classification. All the products needs to be classified as vegetable or not. The business logic is, the product can be classified as vegetable if that product is from company A, B & C. If the product is not from…
4
votes
2 answers

Domain Modelling: Neither an Entity nor a Value Object

In DDD, the domain model consists of entities and value objects, but what do we do when we need something in the model which is neither of these? For example, I have introduced the following ScheduledItems implementation in order to encapsulate…
Dave New
  • 38,496
  • 59
  • 215
  • 394
4
votes
1 answer

Deferred Validation

The Whole Values (1) that quantify a domain model have been checked to ensure that they are recognizable values, may have been further edited for suitability by the domain model and have been Echoed Back (4) to the user. All of these checks…
MJK
  • 3,434
  • 3
  • 32
  • 55
4
votes
3 answers

Aggregate-Root: State Change or fail with Exception or ...?

Aggregate-roots are there to control the state-changes - what is allowed currently and what's not. If the state-transition is allowed, go on. If not, you throw an exception explaining the reason why it was not allowed. But what is if a state-change…