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.

Filter by
Sorted by
Tagged with
3 votes
3 answers
747 views

Is "Transactional outbox" an anti-pattern?

"Transactional outbox" is a pattern for distributed systems which makes use of a single db transaction to do both, persist changes to the domain model and send a domain event message to the ...
user avatar
  • 523
2 votes
3 answers
212 views

domain model logic behavior (ddd)

How domain model capture business logic / domain logic since i cannot access repository? I see many posts saying that domain model = business objects But Business objects live in application layer (...
user avatar
6 votes
1 answer
482 views

How to represent a loop in Event Storming?

I recently ran an Event Storming session and a scenario came up where we needed to represent a loop within the process. The events and commands needed to happen iteratively until a condition is meant ...
user avatar
-1 votes
1 answer
165 views

Modeling a workout schedule using OOP(DDD specifically)

I am just getting into DDD, and I am trying to model a very basic exercise schedule. I have a Schedule and I have a Slot the slot takes 0 - many Exercise entities. The schedule is composed of Slots ...
user avatar
-1 votes
1 answer
163 views

How would you define a domain model for an offer/booking system?

I want to design a domain model for the following system: a customer asks a hotel for rooms availability and prices on a date the hotel send several offers: room type x, price Y, etc the customer ...
user avatar
  • 223
1 vote
2 answers
367 views

DDD - How to decouple two often used together aggregate roots

Context I'm currently developing a notification system with DDD which needs to be able to send the same notification to multiple users. For example, a group of party goers might all be notified about ...
user avatar
0 votes
2 answers
344 views

Where should I put the initialization validation of a Value Object?

Hi I am making a Value Object. public class Age { public Age(int age) { Value = age } public int Value { get; private set; } } I want to check ...
user avatar
1 vote
0 answers
35 views

Managing the output rate for a queue triggered service

I have a service which is triggered by messages from three queues (which are populated by different topics), and writes the processed results to another system (say DB service) synchronously. The ...
user avatar
  • 19
0 votes
1 answer
95 views

Should an entity initialize a value object?

I'm studying DDD at the same time that I'm reading some Khalil Stemmler posts and I'm a little confused about who should initialize the VO: the entity it is related to or the useCase that uses that ...
user avatar
1 vote
2 answers
197 views

Defining Bounded Context in microservices

I need clarification on something from someone more experienced to see if I am on right course with this. Following Microsoft's eShopOnContainers microservices approach I got interested in building ...
user avatar
  • 135
3 votes
1 answer
78 views

Adding EF Core/ORM to API Layer

We are talking about implementing Domain-Driven Design at my company, which sounds like a great step forward for us. That being said, I am left with a few questions after a couple of days of research. ...
user avatar
-2 votes
1 answer
99 views

DDD how to validate whole aggregate

I have AggregateEntity class AggregateEntity { private Enum enitityStatus; private EntityA entityA; private EntityB entityB; private EntityC entityC; //.. more here public ...
user avatar
  • 105
0 votes
1 answer
89 views

Direct communication between message-driven bounded context

My project comprises of serveral bounded context which communicate with each other with RabbitMQ The front end of the project is written in C# and the backend is in Java. The RabbitMQ communication ...
user avatar
0 votes
1 answer
77 views

Designing Integration event application

We have a microservice that integrates with a third party system via REST API to handle appointment booking for our customer. It takes advantage of the event-driven model. Our microservice emits out ...
user avatar
2 votes
2 answers
202 views

Read-only view to reference other Aggregate Roots

In his book Implementing Domain-Driven Design Vaughn Vernon suggests to reference other aggregate roots only by identity and not by reference, like this: // Aggregate Root class Order( val ...
user avatar
  • 796
0 votes
3 answers
641 views

How can I coordinate updating multiple Aggregates as a result of one command, without introducing exploitative possibilities?

I'm trying to figure out how to integrate one command that updates multiple Aggregates in different contexts in a video game. The components/considerations for my particular design are DDD, CQRS, ...
user avatar
  • 2,341
0 votes
1 answer
43 views

Thought process required to design domain aggregate in micro service architecture?

I am using DDD pattern in login micro service used in employee management software. Here Organization/Company is an Entity and User is one more entity. What are my aggregates in this case, if i think ...
user avatar
1 vote
1 answer
64 views

Can objects outside the Application Layer hold references to Aggregate Roots

Reading Domain-Driven Design, on the section of Aggregates, it says The root is the only member of the Aggregate that outside objects are allowed to hold references to, although objects within the ...
user avatar
  • 2,341
6 votes
1 answer
343 views

Too many conversion between layers

I'm developing a back-end application and I ran into the problem of too many conversions between layers. For a single type it is like this: So every time I update the model, I need to update six ...
user avatar
  • 191
1 vote
2 answers
90 views

Locking (reserve) related Aggregate Roots

Problem In my application a user can lock a set of related aggregate roots to work exclusively on them and to avoid the usage of an invalid set of objects later in the process (by other employees). ...
user avatar
  • 796
0 votes
2 answers
170 views

How to implement authorization that needs to be done in the same transaction as aggregate method runs in (DDD)?

Generally most of the authorization in the system is done in authorization layer which then calls commands/queries from application layer, which call methods on domain aggregates. However there are ...
user avatar
-1 votes
1 answer
839 views

How can I orchestrate multiple business tasks?

I have a WebApi backend with a Blazor WASM frontend. The application is split up into 3 main parts. Core, Infrastructure and Presentation. Basic onion architecture structure. Core.Domain Domain ...
user avatar
-2 votes
2 answers
86 views

How would you create abstraction for event holding only Ids - references to other objects

class DomainEvent { } and then I have different events with following structure: class SomeEvent extend DomainEvent { private UUID orderId; private UUID orderlineId; private UUID productId; ...
user avatar
  • 520
2 votes
3 answers
791 views

DDD loophole when one aggregate operation depends on state of another aggregate

I have found interesting problem in DDD, which can be solved extremely simply without DDD, but with DDD looks huge. Let's say I have: Category - AR (AggregateRoot) Product - AR Category can have ...
user avatar
0 votes
1 answer
87 views

Looking for proper way to solve following issue in DDD

I have following requirements: In my system there are conferences and editions. Each edition belongs to one conference Each conference can have at most one current edition Each edition has status of ...
user avatar
0 votes
1 answer
327 views

Query authorization in read model for listing items in DDD/CQRS

In my example app there are admins and modules. Each admin may have some permissions to access a module. Also please note that I am assuming "simplified" DDD/CQRS where read models are ...
user avatar
0 votes
1 answer
151 views

DDD best practices ValueObject immutability when using composition

Pretend I have entities A, B, C, D. They each have a structure as follows public class A{ public IEnumerable<B> Bs {get;} public IEnumerable<C> Cs {get;} public IEnumerable<...
user avatar
3 votes
1 answer
65 views

How to handle changes to local and global representation of an Entity in a distributed environment?

I'm a developer for a retail enterprise IT department, and am currently stuck on the following scenario: Department A is responsible for a CRUD service that's used for handling stores - so when our ...
user avatar
  • 99
0 votes
1 answer
277 views

Can we do domain modelling or create domain entities/models in NoSQL like Amazon DynamoDB? If yes then how?

Recently I was going through an article (link at the end) on AWS for DynamoDB NoSQL and got to know that they are suggesting to only have a single table with certain access patterns in your NoSQL ...
user avatar
2 votes
1 answer
94 views

What is the relationship between Event Store and Persistence Mechanism when designing Aggregate + Event Sourcing?

I'm trying to implement an Event Store, to be used with Aggregate+Event Sourcing (A+ES), and I've run into I think a gap in understanding. I'm reading Implementing Domain Driven Design, using both the ...
user avatar
  • 2,341
6 votes
2 answers
304 views

DRY polymorphic object creation (always valid)

Assuming we have polymorphic entities such as the following, with constructors enforcing invariants (assume there could be lots of sub-classes). What would be an effective/elegant approach to ...
user avatar
  • 321
2 votes
2 answers
1k views

Where should "query" business logic be placed in Domain-driven design?

System description This is a simple eCommerce application containing a Products inventory managed by an Admin. The Products in inventory/repository will show in the User App. Admin has the ability to ...
user avatar
  • 129
2 votes
2 answers
438 views

Domain driven design model version

sorry for the long question, but I love DDD but there is a problem I can't seem to resolve. We have a problem when adding business rules to the aggregate root. Our architecture is mostly like this ...
user avatar
4 votes
1 answer
181 views

How to name a domain concept when experts use different terms?

The DDD literature is quite clear that when a word/term has a different meaning for different users, a Bounded Context should be created to be able to separate the domain models. I'm facing the ...
user avatar
  • 3,468
2 votes
1 answer
202 views

Reusing aggregate root key across bounded contexts?

As the question states, is this bad practice? I have a User aggregate root in the bounded context of Identity for authenticating the user. In this bounded contexts I have fields for the User related ...
user avatar
  • 49
1 vote
0 answers
177 views

Domain Driven Design Exercise

I recently found out about Domain Driven Design and I liked it. However, it is quite overwhelming and requires quite of expertise to get it right. For this reason, I wanted to try to model a simple ...
user avatar
  • 149
1 vote
1 answer
577 views

Bulk Update of DDD Aggregate Roots

In my applications users can perform actions on a few thousand aggregate root instances with a single click. The problem is that the UI is blocked for several seconds (~ 3) what feels too slow. So, I'...
user avatar
  • 796
1 vote
2 answers
166 views

Creating an interface that connects to different data sources

I am working on a project which connects to different data sources and fetches data. The problem is each of these data source needs different parameters to fetch the data s3 = S3(ACCESS_KEY, ...
user avatar
1 vote
2 answers
362 views

Composite Id based on another Aggregate root?

An Aggregate Root should always have a unique ID within the bounded context. Typically the examples one finds use a GUID for this to ensure global uniqueness. However consider a bounded context for a ...
user avatar
  • 49
1 vote
1 answer
74 views

Defining domain logic and finding the correct place to put it

I've been practicing DDD and refactoring an app to understand it's principles and applications better. However I can't fully grasp some of the ideas and how to implement them in my business domain. ...
user avatar
2 votes
2 answers
142 views

How can we update potentially many Read Model Projections based on an Event that is not within the native context?

I have a Shop which sells Items for a given Price. To be clear, this is in the context of a video game, not an enterprise ERP system. The game operator can create Shops that Players can use to buy ...
user avatar
  • 2,341
1 vote
2 answers
687 views

Relationship between entities in different aggregates and size of aggregate

I read a lot about DDD but few thing are still unclear. At this moment I have two dilemma The size of aggregates. How small could be an aggregate? For example we have: class Car { String colorId ...
user avatar
  • 19
2 votes
1 answer
103 views

How to model an action that involves more than one model?

I'd like to start by saying that I'm new to DDD and I'm creating a hobby system to practice some concepts, so this question might be trivial, but not so much for me. I have the following scenario: I ...
user avatar
1 vote
2 answers
477 views

Database Design: Storing price date wise, or date range wise?

I must store prices for various items on multiple dates. The table schema would look like this: CREATE TABLE date_wise_price ( item_code varchar, date date, price numeric(19,4) ) An ...
user avatar
-4 votes
2 answers
67 views

Deciding on the name of a class

I'm working on a domain where we keep track of food that is stored on various locations, like the fridge or the cellar. While implementing the domain, I was wondering what the best name would be for ...
user avatar
  • 93
2 votes
1 answer
212 views

With DDD, how can we model Entities that exist only as an Identity?

In my Domain, I have numerous objects that are expressed by Identity alone. Specifically, several of my Subdomains exist only to represent something that has been created. For example, in a video game ...
user avatar
  • 2,341
0 votes
2 answers
375 views

In an event sourced system, how do I get a current state of an entity?

Let's assume I use Kafka as an event store and put there all the lifecycle events of an order. Now I need to get the current state of this order in my system in during some business process. What's ...
user avatar
4 votes
1 answer
480 views

DDD and CQRS in web applications

Premise A web application that has a frontend / backend separation. The frontend can be the JS framework of the month, which talks to a REST API in the backend. The backend part of the system accepts ...
user avatar
  • 3,468
4 votes
2 answers
716 views

In DDD Aggregate + Event Sourcing, do Events happen before or after state changes?

Part of the Aggregate + Event Sourcing (A+ES) methodology feels uncomfortable. Why does it feel uncomfortable? (As I've read from other questions and the book itself, it's a new-ish way of thinking, ...
user avatar
  • 2,341
4 votes
1 answer
159 views

How can you create two different but linked aggregates without resorting to one transaction?

I have a web application where a user can customize one or more sandwiches to order. Once the user has set up his sandwich, the sandwich is added to an unsubmitted order. The user can add to the order ...
user avatar
  • 163

1 2 3
4
5
29