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)

0
votes
1answer
20 views

In a CQRS/ES application, can projections be dependant?

With event sourcing, you can project an event to create query-optimised read models. This I understand. What I'm unsure about is whether these read models can depend on each other? I'm considering ...
5
votes
1answer
2k views

CQRS + Event Sourcing: (is it correct that) Commands are generally communicated point-to-point, while Domain Events are communicated through pub/sub?

I'm basically trying to wrap my head around the concept of CQRS and related concepts. Although CQRS doesn't necessarily incorporate Messaging and Event Sourcing it seems to be a good combination (as ...
1
vote
1answer
48 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 ...
2
votes
1answer
73 views

Should domain models instantiate other domain models?

I'm reading Domain-Driven Design at the moment and I'm trying to understand what should go in services and what should go in domain models. Say there is an application where you can reserve seats for ...
0
votes
0answers
54 views

What could the best/better/popular way to design an application so that it can at least share backend code across platforms(web/desktop/mobile)? [closed]

I wanted some suggestion/ any input that will help me make some decisions. Somebody might have already faced such situation and dealt with it and have learnt lessons already. Apologies in advance. ...
0
votes
3answers
228 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? ...
0
votes
1answer
41 views

How to check foreign key dependency in ddd aggregate root

When I want to call a constructor on aggregate root class Task, I am interested how can I check if a passed taskType exists in TaskType repository (enforced later in DB on ORM level). I want to ...
2
votes
2answers
114 views

Ubiquitous language and resource based REST API?

I have posted a question regarding Ubiquitous language and maturity level in REST API. Ubiquitous language and maturity level in REST API? After some extensive coding I realized that further ...
4
votes
2answers
2k views

Should we mock entities and value objects when doing DDD?

After reading a few articles about Newable vs Injectable objects and how these concepts relate to DDD's services, entities and value objects, I was left with some doubts about using newables in my ...
1
vote
4answers
997 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. ...
1
vote
2answers
76 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 ...
12
votes
4answers
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 ( http://www....
2
votes
2answers
206 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 ...
0
votes
0answers
51 views

Designing a DOM dependent library

Suppose for fun and learning purpose I need to write a library for forms then, how should I start? to be more descriptive let me summarize my doubts: For beginning I want to restrict myself to just ...
3
votes
1answer
100 views

Comunicating between layers in DDD

Reading the literature of DDD I came up with the following layers: Application Outsider World (Controllers, Crons, etc) Application Services (or UseCases) - which orchestrates multiple Domain ...
14
votes
5answers
413 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 ...
1
vote
1answer
132 views

Got confused while designing Aggregates

I am designing an application, which will store sports statistics, show them in different diagrams and do few more operations on them. Allow user to do some mock drafts etc. I choose to build a ...
7
votes
3answers
248 views

How to combine strict TDD and DDD?

TDD is about designing code, guided by tests. Thus, typical layers aren't usually built upfront; they should slightly appear through refactoring steps. Domain-driven design involves a lot of ...
7
votes
5answers
82 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
66 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
67 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
38 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
85 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
77 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 ...
8
votes
7answers
424 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
106 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
129 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 ...
5
votes
3answers
114 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
38 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
156 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
223 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 ...
2
votes
1answer
86 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
39 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?
4
votes
3answers
94 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 ...
5
votes
2answers
47 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
184 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
92 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 (http://programmers....
1
vote
0answers
112 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. http://www.codeproject.com/Articles/1005485/RESTful-Day-sharp-Security-in-...
2
votes
3answers
100 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
116 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
43 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 ...
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
43 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
142 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
189 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. ...
5
votes
4answers
298 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 ...
4
votes
1answer
116 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
235 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 ...
6
votes
2answers
234 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 ...