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)

2
votes
0answers
112 views

Help understanding modeling in domain-driven design

I've been trying to learn domain-driven design (and similarly Onion Architecture) the last week or so. I think I've got an understanding of it, but like math, I suck at extracting all of the ...
0
votes
0answers
38 views

DDD and read models - where to use?

I'm coding an application using DDD and EventSourcing (therefore CQRS) for the first time. My aggregates are stored in an event stream, so they are not good for querying. That's why I'm building a ...
3
votes
3answers
114 views

DDD design question

I have a question on modelling an Entity\Aggregate root in DDD. I am refactoring a project that uses Entity Framework and business logic as services, the services contain lot of logic which I believe ...
7
votes
2answers
182 views

Should well-known business ID of an entity be represented with a dedicated type in DDD/OOP?

In practical terms it means using an custom (immutable) class over a string or some other primitive type. Examples: Publishing: International Standard Book Number. Finance: International Securities ...
2
votes
1answer
95 views

Integration between services in a SOA

Assume we have a Bounded Context for Inventory (InventoryBC) and another one for Shipments (ShipmentsBC). These 2 BCs need to communicate together. They are hosted on 2 different services on different ...
5
votes
2answers
164 views

Persisting Large/Complex Entities with the Command Pattern — Am I doing it right?

I am in the process of designing and building a large-scale inventory management software-as-a-service that will, hopefully, live a long and fruitful life. Therefore I am exerting a lot of effort ...
0
votes
0answers
61 views

Where does DTOS as InputModel / ViewModel Fit in Layered Archicture [closed]

I'm trying to understand where does InputModel and ViewModels fit at the 4 Layer Architecture. Presentation | Application | Domain | Infrastructure Given that the Application Layer takes care about ...
2
votes
3answers
130 views

Design ideas - validation based on conditions outside of the domain

I am facing a very interesting problem here, and I'd like to see some design ideas from domain driven design perspective. To make it easier to express what I need I have following hypothetical ...
3
votes
0answers
102 views

Domain Driven Design - DataServices vs Repositories for Domain Models vs Database Models [on hold]

I've been trying to refactor an old design in to an Onion Architecture in DDD style. To that point, the project went from a monolith to 4 sub-projects: /src /Project.Application /Services ...
3
votes
1answer
262 views

DDD Validation best practice: entity containing data doesn't have the context to validate before data is set. Where should set function be?

I am pretty new to DDD, so bear with me. I have a Chat room and people in the Chat room. The people in the chat room need to propose a date they would like a webinar to be on. we have a bussiness ...
28
votes
6answers
31k views

Difference between a service class and a Helper class [closed]

I would like to know what differentiates a Service class from a utility class or a helper class? A class only with underlying methods calls the dao's is a service? Doesn't the usage of Helper ...
0
votes
2answers
83 views

Models, types, different views and meta data

We have a software which purpose is to be used to help users build their own applications. It has to be very loose coupled with the infrastructure: for example, I can imagine users running it on MySQL ...
1
vote
3answers
375 views

Repository matrix pattern?

I'm trying really hard to refactor some of my legacy code in the project using best practices and design patterns + DDD so I'd love some feedback on an issue I'm currently having. Let's assume that I ...
7
votes
6answers
13k views

Application layer vs domain layer?

I am reading Domain-Driven Design by Evans and I am at the part discussing the layered architecture. I just realized that application and domain layers are different and should be separate. In the ...
0
votes
1answer
33 views

Bounded contexts should contain just domain code?

In Domain-Driven Design there's the idea of bounded context which is basically a way to stablish a boundary within which a certain model is valid as far as I understood. I've found this idea very ...
3
votes
1answer
352 views

Separation of concerns between repository and service in DDD with complex entities

This probably seems as an example of opinion-based question, but I'm actually looking for rationale on how to decide correctly, I believe there is a correct solution that can be backed by solid ...
0
votes
4answers
158 views

Handling DomainExceptions using REST endpoint

Suppose I'm doing some DDD. Now, I have a microservice reflecting a bounded context/a part of a bounded context. Now, suppose there is a REST endpoint: '/somedomainmodel/someaction' My API user is ...
4
votes
0answers
58 views

Which is the preferable design for my Gateway?

I'm writing a Gateway class that extracts information from a HTML document. One of the responsibilities of the class is to traverse a table in the document and extract data from its rows. I'm trying ...
1
vote
1answer
105 views

Domain driven design with eventual consistency

My domain aggregate is struggling with simple business logic so I feel like I have modeled it incorrectly. The architecture I have right now uses domain driven design with event sourcing. The domain ...
1
vote
3answers
67 views

How to reuse domain model logic in services?

I am trying to avoid anemic domain models as it's said to be an anti-pattern. But doing so leaves my services to duplicate some of the logic. class User { public $status; public function ...
2
votes
0answers
31 views

How do you use Domain Events without obfuscating the control flow? [duplicate]

When we have a system which utilizes Domain Events, it can be quite hard to comprehend the whole workflow (sequence of events) of processing a particular command: how many active handlers we have, how ...
1
vote
1answer
38 views

Maintainability while adding custom findByX methods to DAOs

I'm in the beginning of a project which I want to have the best testability and maintainability possible. To achieve this, I'm reading a lot about concepts in the DDD area, mainly. To get you ...
2
votes
1answer
53 views

Who should be responsible for syncing a repository?

Given an app, controller, model and repository (which holds representation of model), where should the sync service for the repository live? In my specific implementation, my app/controller are ...
6
votes
1answer
242 views

DDD Architecture in a MVC web application

I am putting together a web application using DDD however am strugleing to put the text book DDD model into a real world MVC application. I currently have these layers: Controllers > ...
0
votes
0answers
31 views

How to model relationships in scenario where every product can (don't have to) be associated to only one category

This one still occupies my mind. How do you model 1:N relationships. Consider having a category and product (typical e-commerce scenario). Every product can (don't have to) be associated to only one ...
7
votes
2answers
1k views

Where to validate domain model rules that depend on database content?

I'm working on a system that allows Administrators to define Forms that contain Fields. The defined Forms are then used to enter data to the system. Sometimes the Forms are filled by a human via a ...
5
votes
2answers
103 views

Where should business logic go in a layered architecture?

First of all, i'm not talking about validation in the sense of the nullability or length of a field like in this and this questions where we can use isValid() methods in business classes or an ...
1
vote
0answers
35 views

Loading Aggregate Root from Database with Validations

Here is a similar question Where to validate domain model rules that depend on database content? I am asking this new question because I have more descriptions and I don't want to change the ...
4
votes
1answer
263 views

What and how much domain code should be put in an F# module

According to recommendations given here, F# modules should correspond to DDD bounded contexts, i.e. subdivisions of a business domain. The bounded context I'm working on right now has 2 aggregates ...
3
votes
3answers
189 views

What is business logic code and what is data access code, and what's the difference?

I ask this because it seems people usually consider the code that goes into a DAO or Repository implementation as "data access code", while the code that directly uses these DAOs/Repositories as ...
3
votes
1answer
854 views

How Add/Create* commands should be handled in CQRS + Event Sourcing architecture

I want to implement my first application using CQRS pattern along with Event Sourcing. I am wondering how creation of aggregate roots should be handled properly. Let's say someone sends CreateItem ...
1
vote
2answers
374 views

How does a search functionality fit in DDD with CQRS?

In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context. He presents ...
4
votes
2answers
215 views

Is this too much work for a Gateway to do?

I'm writing a Gateway class that wraps access to a web service which provides information about a player's item inventory in a video game. This web service returns a variety of information, however I ...
3
votes
1answer
185 views

Single source of truth within an enterprise distributed system

Within an enterprise distributed system I have many services - an ecommerce service, a CRM, support desk, finance, billing. Many of these services share common data, such as Customer data. These ...
1
vote
2answers
446 views

What is the best way to create DTOs from entities and update entities from DTOs in a layered architecture?

Option 1: At first I would make a call to my service layer, which served as an API for my core domain, to get a domain object or a list of domain objects and then pass them into the assembler which ...
0
votes
0answers
57 views

A layer of abstraction too far?

Using an enterprise service bus, a message translator pulls a message off the queue ready to be consumed by a service. The translator picks up the message in a canonical data model (CDM) form and ...
0
votes
0answers
41 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
3
votes
2answers
289 views

Should a domain object wrap/contain a DTO interface?

Using .NET - I have an interface IPerson. This interface is implemented by classes in multiple, separate repositories, e.g. EF6 (EfPerson), custom SQL (SqlPerson), or even custom assembly connecting ...
1
vote
0answers
47 views

DDD: Put logic in service or aggregate root?

Let's say we are building a document management system. One project has many documents. I decide to make projects as aggregate root. If the logic to add one document into project is complicated, I ...
4
votes
1answer
81 views

DDD – duplicity between Aggregates – should I use one table?

I understand that there exists duplicity of data between Bounded Contexts. The thing is that I'm not really sure about duplicity of data between Aggregate roots. Example: I have product in Product ...
0
votes
2answers
166 views

Object Oriented Analysis and Design and DDD together

I fear this question seems to broad, so I'll try to explain what I mean with some detail. I couldn't, however, find a way to divide it into other questions. If that's really the case, I gladly accept ...
3
votes
1answer
273 views

Domain Driven Design - designing Aggregate Roots

Imagine you're designing an application for organizing Workshops. Workshop itself is quite complicated - it acts as a state machine with multiple possible states and transitions between them. We're ...
2
votes
2answers
273 views

Domain driven design, can two aggregates have the same root?

For the purpose of separating different functionality into different classes, I have two following Aggregates: ActiveEmployee AssignTask () ReassignManager () Deactivate (string reason) ...
2
votes
2answers
730 views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
14
votes
2answers
467 views

Conceptual mismatch between DDD Application Services and REST API

I'm trying to design an application that has a complex business domain and a requirement to support a REST API (not strictly REST, but resource-oriented). I have some trouble coming up with a way to ...
1
vote
2answers
110 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...
0
votes
0answers
31 views

Controlled access to list of entities vs get/set access in domain model

When designing a domain, either way of following approaches can be used to access list of child entities inside a parent entity. 1. Get/Set Following approach is straight forward and simple to ...
-2
votes
1answer
70 views

DDD - map or object [closed]

What is correct by DDD - should I create map of two objects eg Map or should i use more meaningfull object that will contain this pair MoreMeaningfullName{Obj1, Obj2} ? If using first approach, I ...
0
votes
2answers
157 views

How to use DDD to solve a common address situation?

This is a simple example to show a situation that I find hard to solve with DDD. Consider this: - A property (e.g. a house) has an Address. - An address can be complete or partial (country only; ...
1
vote
2answers
320 views

taxonomy of software project resourcing models

I would like to understand the impact of different resourcing models for software projects. First, I would like to identify the different resourcing approaches that are used to resource software ...