6,925 questions
Advice
0
votes
0
replies
33
views
Storing Domain Events directly in Outbox table vs mapping to Integration Events in Java/Spring (DDD based Microservices)
I have a Spring Boot / Java application following Domain-Driven Design and Event-Driven Architecture.
In my domain service, I create a ReservationCreatedEvent (a domain event) and publish it:
...
Best practices
1
vote
1
replies
32
views
How to enable cross-feature communication in Nuxt without breaking DDD boundaries
I'm building a Nuxt 3 application using a feature-based architecture inspired by Domain-Driven Design.
Each feature is meant to be fully isolated, with its own components, state, API layer, and ...
Best practices
0
votes
2
replies
119
views
How to model and persist entities whose state changes over time
I’m designing a domain model where some entities evolve over time, and I need to keep a historical record of their state that can be retrieved later.
A simplified example:
A Credit Line represents a ...
0
votes
1
answer
50
views
Mapping request to comand to domain class in DDD [closed]
I am not sure what I should do, I am learning DDD + hexagonal architecture in a spring modulith project and our teacher has not given us any examples on how to do this
I have a restaurant aggregate:
...
0
votes
0
answers
37
views
Python command/event registration pattern
I am working on my first service using ddd.
My domain layer looks simillar to:
/ domain
/A
/aggregateA.py -> fires an EventA
/aggregateARepository.py
/B
/aggregateB.py
/...
1
vote
1
answer
84
views
how to decide between entity and value object
I know that there are many articles on this subject and that entity has identity and equality is provided through this identity, while valueObject is provided through its values.
But I'm having a ...
0
votes
1
answer
44
views
Domain Driven Design Aggregate Pattern
In my bounded context we have User and webinar aggregate roots. The invariant is that a user can only be added to webinar once. To fulfill this, webinar aggregate has a list of participant Ids to ...
0
votes
1
answer
81
views
How to return a domain entity with property on a navigation property included from a repository in DDD
I have an entity like this:
public class Article : Entity<ArticleId>
{
public ArticleTitle Title { private set; get; }
public ArticleMarkdownBody Body { private set; get; }
public ...
0
votes
2
answers
123
views
DTOs for data access layer in Nestjs
I've recently started learning Nestjs and backend development in general. I got familiarized with the concept of DTO. Each and every tutorial/article on the Internet focuses on their usage for ...
0
votes
1
answer
85
views
trade-off of update method design of the domain entity
I would like to ask you a question about dividing the method into small units.
It hasn't been long since I learned about DDD(Domain Driven Design).
In both ways, branch logic is likely to increase ...
0
votes
1
answer
107
views
How to avoid N+1 or memory inefficiency when applying DDD Aggregate pattern?
I’m applying the DDD Aggregate pattern in a Spring Boot application.
For example, Order is the aggregate root of OrderItem, and they are mapped like this:
@Entity
public class Order {
@Id
...
2
votes
2
answers
127
views
Where to manage access to an aggregate? Following domain-driven-design rules
Following the domain-driven-design principals,
let's say we are building B2B order management system. One of the requirement is that for each customer/order/order item we should be able to assign ...
0
votes
0
answers
77
views
How to eliminate a dependency cycle
1.When an agent is created, a token is automatically generated.
2.When a token is created, a corresponding UI is also automatically generated.
3.Since the token and UI are tightly coupled, a combined ...
0
votes
1
answer
76
views
When Is Uniqueness Considered a Domain Invariant in DDD?
I'm working on a Domain-Driven Design (DDD) project and I'm trying to clarify when the uniqueness of an attribute should be treated as a domain invariant versus being a technical or infrastructure ...
3
votes
2
answers
261
views
Saving Domain Events on entity in Entity Framework (CosmosDB)
Following domain-driven design, I'm trying to implement an outbox pattern, that will save domain events on an AggregateRoot derived entity in the same "transaction" in CosmosDb.
I'm aware I ...
0
votes
1
answer
84
views
Missing Primary Key Definition in EF Core 8.0 with Strong Type ID and Generic Entity Base
I'm encountering two issues with Entity Framework Core 8.0 when using strong type IDs and a generic entity base class. When attempting to create a migration, I receive the error:
Unable to create a '...
0
votes
1
answer
106
views
How to avoid creating circular dependencies between Order, Bot, and Exchange?
I'm working on a cryptocurrency grid trading system where bots create Order entities. When an Order is created, it triggers a domain event to send the order to the corresponding Exchange. The issue is ...
1
vote
2
answers
38
views
Compliance Central Microservice
I have multiple microservices in my solution, let's call them salary processing, cards, kyc docs, and I need to enforce compliance so that if a kyc doc has expired, I block the card, and if salary ...
0
votes
0
answers
48
views
How to Handle Add, Update, and Delete Operations for an Entity Under an Entity Root in DDD?
I have an aggregate root named Building.
In the Building class, I have three methods for adding, updating, and deleting a building.
When adding a building, I create a new Building object.
When ...
0
votes
1
answer
19
views
Should an domain object Contain a Single Associated object or a Collection in DDD?
I am designing a DDD-based travel planning system in Java, following a layered architecture:
UI Layer → Handles user interactions.
Application Layer → Contains business logic and orchestrates domain ...
0
votes
1
answer
123
views
Entity Framework Core foreign key relationship Guid to ValueObject type
Problem / Context
In my application, I have two entities where the Id of the entities as represented by the database are GUIDs. However, in code I represent these IDs as
readonly record struct ...
1
vote
1
answer
49
views
Should I check equity value in domain entity to prevent unnecessary events in DDD?
My domain entity often looks like this:
class {
rename(string $name): void {
if ($this->name === $name)
return;
$this->name = $name;
$this->...
2
votes
0
answers
192
views
Deptrac uncovered dependency false negative
I have the following issue with an "uncovered" dependency while running deptrac:
App\Infrastructure\Service\ExternalServiceClient has uncovered dependency on
App\Infrastructure\Service\...
0
votes
1
answer
101
views
How to update an entity when implementing DDD using the repository and unit of work patterns with ASP.NET MVC?
My current solution is as follows - I want to know whether this is correct.
Inside a HttpPost action method, I have the following code - Case type is an entity, case variable is passed as a parameter ...
0
votes
2
answers
95
views
Aggregate with many value objects
I've been reading "Implementing Domain-Driven Design" while looking at the code samples, but I'm not sure how to deal with aggregates containing a lot of value objects.
For example, this is ...