Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [domain-driven-design]

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

1
vote
1answer
19 views

DDD - what if aggregate depends on other aggregate

I am modelling UserAggregate using DDD concepts. I know that two separate users should be independent, but when creating a new user, I need to validate, that there is no other user with the same ...
1
vote
1answer
32 views

How does a Repository delete removed Value Objects from the DB without ORM?

Let's say an Entity is composed of multiple ValueObjects. For instance, a wanderer might leave a few footprints behind. Imagine I load Wanderer from a repository and delete all footsteps north of the ...
2
votes
1answer
41 views

Should I store an event stream or just state for a frequently changing entity?

I am building a CQRS-based application with Kafka Streams. For most entities in my application this entails event sourcing: capturing state mutations as events and transforming them into state which ...
2
votes
1answer
67 views

How to model domain events so that the denormalizers can fill highly denormalized read models

I have been working with a software strongly relying on the event sourcing and CQRS patterns for a few time and I'm trying to figure out how to properly model the domain events in relation to the ...
1
vote
1answer
87 views

How to update attributes on an entity from remote bounded context?

I see a lot of guidance in the DDD community around how to retrieve and use information from a remote bounded context (using an anticorruption layer, open host service, etc.), but hardly anything ...
7
votes
2answers
225 views

Is domain/persistence model isolation usually this awkward?

I'm diving into the concepts to Domain-Driven Design (DDD) and found some principles strange, especially regarding the isolation of domain and persistence model. Here is my basic understanding: A ...
0
votes
1answer
22 views

Can a bounded context be made up of other bounded contexts?

I am arguing with co worker that a bounded context can be made of other bounded contexts. My example is: I am having a tour context made out of flight bounded context hotel bounded context visa ...
0
votes
0answers
23 views

Aggregate inheritance in DDD [duplicate]

So one thing you do not hear much about is inheritance with DDD. Currently I have an Account aggregate that handles details regarding a financial account and its subaccounts. Then a Transaction ...
-1
votes
4answers
140 views

In a Domain Driven Development DDD, have a validation on a DTO that calls a external service is wrong, if yes, where should it be?

I have this question, is more about pattern and in theory what is wrong or not instead of if is possible or not (because it is). In a DDD design, I have a DTO that I am validating, to check not nulls,...
0
votes
2answers
62 views

DDD - Domain events vs application events

I'm considering two types of notifications: Domain events used internally within a bounded context Application events used to exchange notification messages between bounded contexts Each aggregate ...
1
vote
2answers
36 views

Denormalising a CRUD and ES bounded context for rich queries

As a small snapshot of my product, I have 2 bounded contexts, one which is a rich domain with defined events and invariants, operating on files implemented as CQRS/ES, and the other a CRUD store of ...
0
votes
0answers
25 views

Mapping Domain Object to Persistence Layer avoiding Abstract Factory

I am trying to implement the Metadata Mapping pattern for mapping domain object to db through reflection. I am getting difficulties in decoupling my classes from MongoDb. You can see in classes ...
1
vote
0answers
29 views

Splitting a Bounded Context - administration and execution

TLDR: not quite sure whether I got my Bounded Context right. Situation I have a domain model in one Bounded Context: Entire model is in the same bounded context. Bounded context has two ...
1
vote
1answer
43 views

DDD Scheduling Flights

I'm fairly new to DDD and have been building a virtual airline app for flight simulators and I'm having trouble modelling the scheduling part of the app. A bit of the domain details: first you start ...
1
vote
2answers
45 views

get aggregate id based on its data in it

I have an aggregate root called SizeRangeAggregate which holds the range of size of clothing piece dimension and price for that range. I created an post rest API which create new SizeRangeAggregate. ...
0
votes
1answer
55 views

Where should domain events be added: in entities or aggregate roots?

I'm designing the base classes and I don't know if I should add the field 'domainEvents' to the Entity class or only to the AggregateRoot class. I must add the code for add and remove events in ...
0
votes
1answer
55 views

DDD - How to do informative validation (specifically on entity creation)?

For my domain entities currently, all validation errors cause exceptions to be thrown. I don't like this as it doesn't allow me to compile all validation errors before exiting a method. I'd like to ...
0
votes
0answers
10 views

Is there any value in passivation (setReceiveTimeout) for persistent actors without read store?

I am not experienced in Akka, so my assumptions may be completely wrong. As far as I understand, Aggregate Root may manage its entities either just keeping their state internally and restoring it at ...
0
votes
1answer
91 views

Message Bus v Mediator pattern v In Memory Bus

I am struggling to understand when to use each of these: 1) Message Bus: Used to send integration events between Microservices. For example, Microservice A could publish an integration event, which ...
1
vote
2answers
86 views

Construct Entities via Dependency Injection Framework

I need help settling a disagreement, a co-worker and I have. We're working on a pretty huge Angular project and are in the process of looking at incorporating some Domain Driven Design principles into ...
1
vote
2answers
92 views

DDD : Can you event storm on your own?

I've recently been introduced into Domain Driven Design and we've done a lot of event storming in a simulated environment with a lot of people. Now I'm back in the real world and I've been given a ...
-1
votes
3answers
164 views

What is a CRUD system?

I am learning Event Sourcing in my spare time. I see lots of references to 'CRUD type systems' online. I understand a CRUD type system to be: 1) A database driven system (website or application) i....
2
votes
2answers
55 views

How to implement semantics of serializability in eventually consistent system?

In a distributed asynchronous system serializability cannot be achieved, but we still have to somehow provide the semantics. Consider quite natural requirement that user must have unique email or no ...
3
votes
2answers
85 views

Separating Domain Object and Data Models

I looked through a lot of articles, blogs, and SO topics about separating domain object and data models. Almost every answer said: You should have separate classes for the domain and data persistence, ...
1
vote
0answers
47 views

DDD: How to resolve aggregate members needing dependecies?

I have the following aggregate: Checkout (root) Requirement: CouponRequirement, AnotherRequirement, YetAnotherRequirement Coupon A Checkout has many requirements that need to be fulfilled in order ...
2
votes
1answer
77 views

Understanding DDD when using an ORM such as Hibernate

I've reading about Domain Driven Design and Anemic models. I generally work with an ORM such as Hibernate, and I'm struggling to understand in DDD what a business model can and can't do. For example,...
2
votes
2answers
94 views

How do entities, DTO, DOA work together and what’s their role within a system?

Most of my work is written in Java using Spring Boot. In a recent project my entities contained no business logic, Spring Data was used to handle repositories and I have service classes that ...
3
votes
1answer
105 views

On layered architecture with ddd

I've been working on an architecture, trying to learn more about DDD, layered architecture, etc. Here's what I have: Domain Here I have my entities, the classes that directly map to a database table....
4
votes
1answer
214 views

Is it worth considering State pattern in this case

I've got the following state diagram that can be seen in Webgraphviz: digraph reload_states { rankdir=LR; size="8,5" node [shape = doublecircle]; Requested; node [shape = circle]; ...
4
votes
1answer
88 views

Repository that performs API calls internally - DDD

Please note: although my question relates to DDD, I am also interested in this from an architectural and OO design perspective. This question may also be a simple case of CQRS and/or interface ...
0
votes
1answer
49 views

In an n-layer architecture with MVP in the presentation layer, how the presentation layer interacts with the business layer?

I am pretty new to software architecture, and I am trying to understand the basic concepts of n-layer architecture and MVP (specifically Passive View). My current understanding of n-layer ...
2
votes
1answer
73 views

DDD with web application - How to avoid rule duplication?

Imagine we have a simple rule: A member must be at least 18 years old to join. Imagine we have a C# class for Member and it is our domain model. The rule is enforced in this class. Now we create ...
0
votes
0answers
38 views

Questions about modeling a queue with DDD principles

Let's take the following exercise: A system can have hundredth of queues Each queue can have hundredth of entries There can be thousands of elements in the system Each element can be enqueued and ...
2
votes
1answer
156 views

Access multiple entities in repository - clean architecture

I have a API call that returns a list of Payments, each Payment contains a User. I need to call it, save the results in the database, fetch all the payments and users and return them all to the ...
2
votes
2answers
110 views

Strategy/domain object responsibilities

Assume we are in the world of car rental application :) Let's say that I have 3 types of cars with 2 categories of price: Car type Price category ------------------------------ Sport ...
0
votes
1answer
121 views

Implementing CQRS inside a Microservice

I am considering a CQRS refactoring process. It is more of a learning exercise in my spare time. The use case is similar to a price comparison website where a user enters their details for a ...
1
vote
2answers
304 views

Putting it all together - DDD, CQRS, Web API

I need some expert guidance. I'm trying to learn the concepts as well as implement them, and it's possible I might be over-engineering some. But that's OK, because I am wanting to learn and gain ...
4
votes
3answers
506 views

Mapping API models(DTOs) to rich domain models

How to implement HTTP's PUT that works with child collections when using DDD's rich domain models? Let's say we've got an aggregate root with a nicely encapsulated collection of items: (I omitted ...
2
votes
5answers
152 views

Is a point drawn on a canvas considered an entity in domain driven design?

I'm reading on DDD and came across this excerpt: Let’s consider a drawing application. The user is presented a canvas and he can draw any points and lines of any thickness, style and color. It is ...
0
votes
0answers
25 views

Object mapping vs projection with ASP.NET Core

Many examples I see using ASP.NET Core involve one or more of the following: Web app or api that configures a DbContext via dependency injection. A class library that contains a Entity Framework ...
1
vote
1answer
79 views

DDD Relations between child entities / value objects

I'm new to DDD and trying to wrap my head around it by writing a prototype for an application (Core-Logic-Layer). My domain model looks like this atm. (I leaved out parts, that weren't necessary for ...
0
votes
1answer
61 views

What is the correct granularity for events in the context of designing a rule-based decision system?

Introduction We need to design a system that, given a set of events that are happening in the source application, reacts to them and if some conditions have been met, actions can be triggered. Users ...
2
votes
0answers
44 views

UI syncing in case of bulk operation api

In a CQRS system, the convention that we follow is we render the detail view of an aggregate(i.e getById) using the write model and views containing multiple aggregates(like a dashboard) using read ...
2
votes
0answers
39 views

How to design a sync api exposed to third party which involves a business transaction across aggregates?

Business Domain In the Sales domain, I have 3 entities - Lead, Contact and Opportunity. A lead is injected into the system from many sources and nurtured. If it is a prospect then it is converted ...
0
votes
1answer
53 views

Is changing the domain according to the user privilege on specific fields considered as anti-pattern?

Is changing the domain according to the user privilege on specific fields considered as anti-pattern? My case: I have Schedule Entity (aggregate root) like this: public class Schedule : Entity<...
2
votes
4answers
192 views

Command handling fail feedback with CQRS

We are developing some context using CQRS approach. We have ended up with command handlers emitting events. It seems to be not a good idea to us. However we can't find any alternative approach. We ...
2
votes
1answer
73 views

Modeling request/response in domain driven design

Say I have a class of User and that user has an Id & Name, in request response modeling, I would make a request with Name on it and a response with Id and Name, thereby my domain model would be ...
1
vote
3answers
51 views

Event Sourcing - Reconstituting Aggregate from Wrong Event Stream

I am working on a project to help learn DDD and am trying to do CQRS and Event Sourcing. Code is in C#. For this example, lets say I have 2 aggregates, Customer and Product. My aggregate repository ...
3
votes
3answers
94 views

How are new bounded contexts deployed, and bugs fixed, in message-driven “autonomous” microservice architectures?

I'm coming from the monolith background, using a single large relational database. From my research, many proponents of the microservice architecture favor the event-driven rather than REST driven ...
5
votes
2answers
240 views

Deconstructing monolith software bounded contexts for domain driven design

I'm starting to dive into domain driven design for a new project. The software solution will be used by several departments to assign tasks to their employees. The task assignment process is mostly ...