Domain-driven design (DDD) is an approach to develop software for complex needs by connecting the implementation to an evolving model.

learn more… | top users | synonyms (1)

6
votes
3answers
929 views

Duplication in parallel inheritance hierarchies

Using an OO language with static typing (like Java), what are good ways to represent the following model invariant without large amounts of duplication. I have two (actually multiple) flavours of the ...
5
votes
6answers
494 views

Should a domain expert make class diagrams?

The domain expert in our team uses UML class diagrams to model the domain model. As a result, the class diagrams are more of technical models rather than domain models (it serves of some sort of ...
5
votes
3answers
4k views

DDD with ORM where should the business logic go?

I have used an MDA (model driven architecture) tool in the past where we modeled via UML and this generated the business entities (our domain model) and the ORM (mapping etc) amongst other things. A ...
5
votes
3answers
1k views

DDD - Aggregate Roots - Dealing with Efficiency and Concurrency

First off, I'll admit that I'm a newbie to DDD and need to read the "blue book". I'm building a system that has an AggregateRoot of type "Match". Each Match can have a collection of "Votes" and also ...
5
votes
1answer
213 views

Tools to support learning a new business domain

Suppose you just accepted a job, writing code in an industry sector that you've never worked in before. To be effective, you want to immerse yourself in the business domain - to understand the ...
5
votes
6answers
225 views

In a team practicing Domain Driven Design, should the whole team participate in Stakeholder meetings?

In my experience, a Software Development Team that comprises: 1 Project Manager 1 Tech Lead 1 - 2 Senior Dev 2 - 3 Junior Dev (Fresh grad) Only the Tech Lead & PM (and/or Senor Dev/s) will ...
5
votes
1answer
259 views

DDD: service contains two repository

Does it correct way to have two repository inside one service and will it be an application or domain service? Suppose I have a Passenger object that should contains Passport (government id) object. ...
5
votes
2answers
949 views

Are Persistence-Ignorant objects able to implement lazy loading?

Persistence Ignorance is an application of single responsibility principle, which in practice means that Domain Objects (DO) shouldn't contain code related to persistence, instead they should only ...
5
votes
2answers
340 views

How to define the seams between the domain layer and a database full of stored procedures?

We have a legacy database full of stored procedures. These stored procedures are somewhat CRUD-categorized but upon inspection of some procedures, they are not "simple" as they might update, delete, ...
5
votes
2answers
290 views

DDD: Can immutable objects also be entities?

I've read countless posts on differences between Entities and Value objects and while I do think that at least conceptually I understand how the two differ, it appears that in some of these posts ...
5
votes
4answers
742 views

Refactoring jQuery spaghetti code to use DDD [closed]

Most of my client side code ends up as a long script in one file the mostly looks like this: <script> function someFunction1(){/*...*/} function someFunction2(){/*...*/} ... var ...
5
votes
3answers
519 views

Good practices to implement mappers in a multi-tier application

When you are working with a multi-tier application very often you run into task of converting objects in one layer to objects in another layer. This could be converting database objects into domain ...
5
votes
1answer
416 views

To Repository Or Not To Repository

When I first learnt about Domain Driven Design, I was also introduced to the repository and unit of work patterns that once seemed to be top notch for the cool kids that threw SQL queries like ...
4
votes
5answers
539 views

How to model an address type in DDD?

I have an User entity that has a Set of Address where Address is a value object: class User{ ... private Set<Address> addresses; ... public setAddresses(Set<Address> ...
4
votes
4answers
326 views

Data access for composable applications

I'm wondering if anyone can share their thoughts, experience and guidance on how to approach the data access layer for a composable application? By composable application, I mean an application with ...
4
votes
3answers
1k views

DDD and Value Objects. Are mutable Value Objects a good candidate for Non Aggr. Root Entity?

Here is a little problem Have an entity, with a value object. Not a problem. I replace a value object for a new one, then nhibernate inserts the new value and orphan the old one, then deletes it. Ok, ...
4
votes
3answers
489 views

Scrum, DDD, and front-end development in an enterprise environment

So, I've been working for a bank for the past 4 years. My main responsibility has been online banking. Over the past year, we've been implementing the scrum methodology. We've also changed to domain ...
4
votes
1answer
586 views

How to deal with queries that do not return full entities in Domain Driven Design?

In my application, I have a listing of information that is deducted from a query that combines information from several entities. In itself, a very common situation. Now, the corresponding repository ...
4
votes
2answers
1k views

Do we achieve 100% Persistence Ignorance solution if we're not using ORM's POCO objects to model the Domain?

Persistence ignorance is ability to retrieve/persist standard objects, where standard objects are considered as classes focused on particular business problem and thus don't contain any ...
4
votes
1answer
387 views

Is it Ok if Domain Object cross Service Boundary

Is it Ok if Domain Object cross Service-Boundary? Everyone recommend that only DTO should be returned by Services. I am creating simple CRUD application. Is it ok if my service methods return ...
4
votes
2answers
2k views

DDD – A rookie’s unanswered questions

I’ve decided to use DDD in one of my pet projects to find out what the fuss is about! Let me start off by saying that this (DDD) is the way software SHOULD be written, I’ve seen some strange patterns ...
4
votes
1answer
927 views

Unique Value Object vs Entity

Trying to convert some entities into value objects I am stuck in a case where what seems a value object must be unique within an aggregate. Suppose we have a Movie entity which makes the root of an ...
4
votes
4answers
253 views

How to decide whether to implement an operation as Entity operation vs Service operation in Domain Driven Design?

I am reading Evans's Domain Driven Design. The book says that there are entity and there are services. If I were to implement an operation, how to decide whether I should add it as a method on an ...
4
votes
2answers
319 views

How should I include third-party models in my domain model?

I'm currently trying to design a little application using Domain Driven Design but I'm afraid I don't really get the concept yet. Let me try to explain this as clearly as possible. public interface ...
4
votes
2answers
1k views

Should I use an aggregate root when designing my repository?

I have an entity that is called Master which is composed of a number of Slave entities. There can only be one Master in my database and I want to query repositories to get the Slave for a given id. ...
4
votes
3answers
296 views

Architecting multi-model multi-DB ASP.NET MVC solution

I have an ASP.NET MVC 4 solution that I'm putting together, leveraging IoC and the repository pattern using Entity Framework 5. I have a new requirement to be able to pull data from a second database ...
4
votes
2answers
332 views

A design decision in composition or aggregation

I've recently had doubts about some design decisions that I frequently make, so this time I decided to take some time and try to analyze it to find the best solution. I will describe a simple scenario ...
4
votes
2answers
544 views

Justification for bidirectional relationship

I typically try and avoid bidirectional relationships at all costs. Recently I've been trying to follow a more domain centric design philosophy and I'm looking for advice in the best way to solve a ...
4
votes
2answers
310 views

Domain Objects with Interfaces

I'm in a situation where part of my system has a dependency on another module in the same system, but the modules themselves need to remain independently deployable, where the parts they depend on ...
4
votes
1answer
177 views

OOP, domain models, and the user

When developing domain models, I can see two major ways of thinking about the user: The first one assumes that a program is a kind of "simulation" of what happens in the real world, and the user is ...
4
votes
2answers
266 views

Keeping a domain model consistent with actual data

Recently domain driven design got my attention, and while thinking about how this approach could help us I came across the following problem. In DDD the common approach is to retrieve entities (or ...
4
votes
2answers
286 views

DDD and filtering

I am developing an app in ddd maner. So I have a complex domain model. Suppose I have a Fare object and Airline. Each Airline should contain several or much more Fares. My UI should represent Model ...
4
votes
1answer
499 views

Distributed application using RabbitMQ

I am on my way to create an application with 4 bounded context using CQRS & event sourcing. In order to make these bounded context talk to each other I was planning on using Rabbit MQ. My ...
3
votes
3answers
2k views

DDD + POCO does this makes sense?

DDD promotes rich domain models with behavior in it, POCO naked objects without any objects in it. Is it possible to have them both combined? I have a Multi Layer Solution Core - has POCO ...
3
votes
5answers
491 views

What is the business cost of anemic domain model

I am looking to quantify the cost or problems of bad software development practices. Specifically can software that has been developed resulting in an anemic domain model be quantifiable in terms of ...
3
votes
7answers
914 views

Inheritance using non-abstract base class

This post is based on the question http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance/11758048#comment15634305_11758048. Some people said - check whether there is “is-a” ...
3
votes
2answers
285 views

Single Responsibility principle VS KISS principle

Let's assume the modeling of User model in a context of a social network. User concept is composed of two notions: Authentication elements like userName/Password/Email etc... Extra data information ...
3
votes
2answers
1k views

Should this code/logic be included in Business Objects class or a separate class?

I have created a small application which has a three tier architecture and I have business object classes to represent entities such as User, Orders, UserType etc. In these classes I have methods that ...
3
votes
3answers
230 views

OOP what is meant by object-to-object communication

I've been reading in basic concepts of OOP,as i'm trying to make this shift from transactional scripts to more oop manner in php, and i often come across this definition : An object stores its ...
3
votes
2answers
538 views

Encapsulation in Domain Driven Design models?

I am using EF Code First and I had a model like below. public class Account { [Required] public string AccountNo { get; set; } [Required] public decimal Balance { get; set; } } I ...
3
votes
4answers
1k views

DDD: Service or Repository

I am developing an app in DDD manner. And I have a little problem with it. I have a Fare (airline fare) and FareRepository objects. And at some point I should load additional fare information (from a ...
3
votes
1answer
101 views

Handling ground-breaking changes in a production system - Insert intermediate level Management object

As our client request, we are proceeding to change the base of our system. We already have the following structure: A class has many students. (simple typical one - to - many) Now we must change ...
3
votes
2answers
954 views

What is a value object in domain-driven design?

I have an entity and I've realised that there is a group of properties that work together. So, I moved them to a value object (together with their behavior) and now I have a reference from my entity ...
3
votes
1answer
273 views

How a .NET dev team should be designing and delivering greenfield projects? [closed]

Some of the hottest topics in the software world atm are: Domain-Driven Design SOLID principles Agile methodologies ORM Now assuming that you are not currently using all of these in your team, ...
3
votes
1answer
182 views

Wouldn't Layer Supertype pattern corrupt our domain model?

a) To my knowledge Domain Objects should for the most part be oblivious to technical aspects of a design. Since I view class inheritance as being a technical solution, wouldn't introducing a Layer ...
3
votes
2answers
374 views

How far to go with Domain Driven Design?

I've read a little about domain driven design and the usage of a rich domain model, as described by Martin Fowler, and I've decided to put it in practice in a personal project, instead of using ...
3
votes
1answer
127 views

Ubiquitous Language and Custom types

Note that my question is referring to those attributes that even on their own already represent a concept ( ie on their own provide a cohesive meaning ). Thus such attribute needs no additional ...
3
votes
2answers
330 views

DDD: Developing the Domain Model alone

In DDD examples it seems the common method for developing the domain model is to sit with domain experts and iterate over versions of the model, say on a whiteboard, continually modifying it and ...
3
votes
1answer
805 views

Forcing aggregate root child access through the aggregate root alone

Context I'm developing an application using a Domain Driven Design approach. I want to use a design pattern wherever appropriate and apply all SOLID principles. Scenario I have an order and I want ...
3
votes
3answers
360 views

Breaking the “ubiquitous language” by having an IoC Container in Domain Model?

I am a bit new to DDD and bear with me if my understanding seems way off. My question is about Udi's solution to domain events, particularly the class DomainEvents (see code below) An excerpt from ...