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)

3
votes
4answers
46 views

How to treat validation of references between aggregates?

I'm struggling a bit with referencing between aggregates. Let's assume the aggregate Car has a reference to the aggregate Driver. This reference will be modelled by having Car.driverId. Now my ...
0
votes
1answer
49 views

Where do I create/instantiate repositories in DDD that are used my Domain Services

From what I understand a DomainService should be implemented against a RepositoryInterface, so we could change with easy the repository (which its a part of the Infrastructure layer) So, if I have: ...
4
votes
3answers
46 views

In CQRS/ES, can a command create another command?

In CQRS/ES, a command is sent from the client to the server and routed to the appropriate command handler. That command handler loads an aggregate from its repository, and calls some method on it, and ...
0
votes
0answers
32 views

In an event driven microservice environment, are domain events equal to topics?

A lot of messaging frameworks have the term "topic". In a ddd microservice architecture, do these topics always reflect the domain events?
1
vote
1answer
79 views

How to atomically create a new entity in multiple contexts without coupling?

Let's assume there are multiple contexts with the same logical entity but with different notions. Creating such an entity should have the side effect that in all other contexts the same logical entity ...
2
votes
1answer
69 views

What's the difference between an implementation detail and a technical concern

I just wanted to make sure that I understand and can properly articulate the difference between these two concepts. I've always thought of an implementation detail as being the internal workings of ...
1
vote
1answer
45 views

Where should you validate the state of “other” aggregates?

Scenario: A customer places an order, then, after receiving the product, provides feedback on the order process. Assume the following aggregate roots: Customer Order Feedback Here are the ...
8
votes
7answers
419 views

Design pattern for “operation on object allowed, only if object is in certain state”

For example: Only job applications that are not yet in review or approved, can be updated. In other words, a person can update his job appliance form until HR starts reviewing it, or it's already ...
4
votes
2answers
98 views

Is there an elegant way to check unique contraints on domain object attributes without moving business logic into service layer?

I have been adapting domain-driven design for about 8 years now and even after all these years, there is still one thing, that has been bugging me. That is checking for a unique record in data storage ...
5
votes
2answers
120 views

Recreating complex aggregates from a persistance source

I'm building a web application with C#, and I have an aggregate root which has several entities and value objects. Then I have a repository object which persists the aggregate to the database (I'm ...
0
votes
3answers
209 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? ...
5
votes
3answers
110 views

How do you deal with legacy data integrity issues when rewriting software?

I am working on a project which is a rewrite of an existing legacy software. The legacy software primarily consists of CRUD operations (create, read, update, delete) on an SQL database. Despite the ...
0
votes
0answers
36 views

Is there a ddd approach for sending events about embedded aggregate views

I'm investigating how we can notify UI/async clients (websocket) about an update which happened in an embedded view. Let me elaborate... We currently have a newsfeed where NewsItem is an aggregate ...
2
votes
2answers
121 views

Could REST api be considered as a presentation layer in DDD?

I read a lot of questions about this concern, and some of them are Presentation VS Application layer in DDD Application layer vs domain layer? So my question is if the top layer is REST API and ...
6
votes
2answers
214 views

Is the command design pattern a good way to reduce the number of dependencies in my class?

I recently realized that I have way too many dependencies in many of my classes. Now I am trying to solve that for the most important class. I think I have an idea how but I'm not sure if it is the ...
1
vote
2answers
70 views

Saga's and Query model transaction ordering

I have the following Ubiquitous language defined by our domain expert: A User can find UserGroups and add himself to it. A user can query a list of UserGroups where he is member of and remove himself ...
1
vote
2answers
186 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 ...
2
votes
1answer
84 views

Can I manage transactions in the UI

Do I need an "application/service" layer to manage transactions if the domain layer only services the UI? In other words, can't I just manage transactions in the UI when I have only one consumer of ...
0
votes
2answers
38 views

Domain object using DAO within a transaction

Is it considered good practice to start a transaction in the "service/application" layer, and then have objects in the domain model make DAO calls which participate in that transaction?
3
votes
3answers
88 views

How can you separate a monolith into domain-driven libraries without duplicating interfaces and still keep dependencies simple?

I'm working on a project with web services, and I've been structuring things where: The web service contains the business logic layer A library which handles the data access layer I've recently ...
11
votes
4answers
335 views

Is it still valid to speak about anemic model in the context of functional programming?

Most of DDD tactical design patterns belong to object-oriented paradigm, and anemic model describes the situation when all business logic is put into services rather than objects thus making them a ...
5
votes
2answers
45 views

How can I protect an EventSourced aggregate from user-generated event storm?

Let's say you're building a social web app where an aggregate root (f.e. BlogPost) could be liked and unliked. Now consider a malicious user who wrote a script to perform an endless amount of like and ...
4
votes
2answers
164 views

Ubiquitous language and maturity level in REST API?

According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html Since DDD uses ubiquitous language, I am ...
4
votes
2answers
1k 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 ...
2
votes
3answers
85 views

What should be primary guideline when defining a bounded context?

When defining bounded contexts of a Domain, what should be a primary guideline: departments (Sales/Manufacturing/Warehousing), where each department has a common context ...
1
vote
0answers
99 views

How to authentication user in REST API (domain driven design)

I am using REST API as a presentation layer of a DDD project. In order to secure API calls I am using token based security. ...
2
votes
3answers
92 views

How to clearly define boundaries of a bounded context

After a month or so of reading and researching DDD, I decided to start my own project and created DDD with these bounded contexts> Clients Products Orders Billing Each bounded context has rest API ...
1
vote
1answer
100 views

why exposing service instead of repository in onion architecture

I'm digging on how to structure projects and so I stumble into Onion Architecture. As to how I understand it, its more on a domain-centered-focus architecture instead of a database-driven type. I'm ...
5
votes
1answer
42 views

Using domain events to express some reached state

In general, domain events are used to make a notification, when something has happened to entity, but is it okay - from perspective of ddd - to use domain events to make a notification, when entity ...
1
vote
4answers
942 views

How do you make a service stateless?

When doing Domain Driven Design it is advised that services should be stateless. There are several kinds of services when doing DDD: Application services. Domain services. Infrastructure services. ...
4
votes
4answers
296 views

Should an object be able to represent itself across components?

I'm working on a networked game. I have tried to design the various components (client, server, engine) to only about things within their domain. For example, the server should only be concerned with ...
1
vote
1answer
38 views

How can I cascade changes from one aggregate root to another?

I'm having trouble modelling a relationship in DDD. I have four entities: Claim - defines access to a Service. Service - a web service. A Service has many Claims and can belong to any number of ...
2
votes
3answers
126 views

In DDD, is validation application logic, or domain logic?

Suppose that we are modelling a form using DDD; the form may have certain kind of business rules associated with it - perhaps you will need to specify an income if you are not a student, and you are ...
1
vote
2answers
187 views

Design of an online book reader

I want to design an online book reader system as a programming exercise. I wrote down the following requirements: Searching a book by title. Bookmarking a book. Mark a book as favorite. Give rating. ...
4
votes
4answers
229 views

If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?

I've recently read a lot of arguments against using the repository pattern with powerful ORM's like Entity Framework as it incorporates repository-like functionality, along with Unit of Work ...
10
votes
3answers
5k views

DDD, Saga & Event-sourcing: Can a Compensate Action simply be a delete on the event store?

I realize the above question probably raises a few 'what??'s, but let me try to explain : I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( ...
4
votes
1answer
114 views

Using delegates as named lambdas

Suppose we have a domain in which we can generalise some operation by passing in a function, like the Select \ map functions. Now suppose that the function we pass in has some domain specific name, ...
0
votes
1answer
232 views

Rich Model vs God Class [duplicate]

I have a legacy code containing some behaviour classes, like services and controllers. My model is pretty anaemic. It's just a repository of getters and setters, and I want to refactor it. There is a ...
5
votes
2answers
179 views

DDD: Creating reusable modules and service type distinctions (Domain, Infrastructure, Application)

So after reading "Implementing Domain-Driven Design by Vaughn Vernon" I've decided to refactor my code for better re usability by isolating what I believe to be core domain concepts into separate ...
1
vote
2answers
638 views

DDD and collections and paging of related models?

I have a rich model, where e.g. one model A depends on many related entities/value objects. Therefore we have methods in A for retrieving collections of related objects: getFoos(), getBars() and so ...
3
votes
2answers
87 views

Repository pattern and Dependency Injection without an ORM

I want to implement the repository pattern in an old legacy project. I already did some research, and found that, without an ORM, it's completely acceptable to have methods like ...
0
votes
0answers
67 views

Bringing in unit test code with Mocking Frameworks in an established ASP.NET C# software application

Here is the information about my development environment: MongoDB 3.0.0 MongoDB C# Driver Version 1.7.0.4714 Microsoft Visual Studio Professional 2013 .NET Framework 4.0 We are about to do our ...
5
votes
3answers
2k 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 ...
2
votes
2answers
138 views

Are DDD aggregates a good boundary for unit testing?

An aggregate can represent a somewhat stable system boundary. Does it make sense to write input and output test aggregates to do most testing? In theory we could use an aggregate as a data driven way ...
2
votes
2answers
88 views

Multiple implementation architecture inside a single bounded context?

In all DDD books I read so far, they say a bounded context can have its own implementation architecture, which suggests a single architecture per bounded context. In my journey of DDD and also CQRS, ...
5
votes
1answer
359 views

DDD CQRS - per-query and per-command authorization

Summary Should authorization in CQRS/DDD be implemented per-command/query or not? I am developing for the first time an online application using more or less strictly the DDD CQRS pattern. I bumped ...
1
vote
2answers
129 views

Transactional consistency with external API calls

I have an DDD application that makes use of two external APIs: Google Calendar API and Google Gmail. In one of the application services I want to create a calendar event (using the Calendar API) and ...
2
votes
2answers
92 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 ...
11
votes
4answers
4k views

When should an Aggregate Root contain another AR (and when should it not)

Let me begin by first apologizing for the length of the post, but I really wanted to convey as much detail up-front so I don't take your time going back and forth in comments. I am designing an ...
0
votes
0answers
53 views

Namespace naming and parts of speech

I keep coming up with the following Namespace names. They feel right when I just type them out in a text editor, but it's bothering me that they're not the same .. I'm going to use the word "part of ...