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
0
votes
1answer
31 views

When to model an aggregate's entities as part of a value object?

I've read a lot about Domain Driven Design including books from Eric Evans and Vaughn Vernon. So I am familiar with the concepts Aggregate Root, Entity, and Value Object. But while I was modeling ...
4
votes
1answer
100 views

Are there any pitfalls to having multiple handlers for a command?

We're looking to split up a monolith. In order to do so, we've identified some business areas that look like good candidates for subdomains, and we're trying to figure out how to split the ...
1
vote
3answers
49 views

What http error to return in case of validation and business rules in a domain driven design api

I have a .net core api trying to implement it according to domain drive design principles. In the domain layer there is a public Create method that contains all validation and business rules. If one ...
4
votes
3answers
126 views

Where to convert primitive types in meaningful types in Clean Architecture / Onion Architecture

The book "Implementing Domain Driven Design" (page 361) suggests to use special types to distinguish several kinds of IDs, e. g. using BookId(1) instead of just 1 of type Int or Long. In my Clean ...
3
votes
2answers
140 views

Should entities have nullable id because they're autoganerated by the database?

Suppose I have a domain entity representing a person. (Examples in TypeScript) class Person { constructor(public name: string) {} } Now, because other parts of the domain will need to reference ...
1
vote
1answer
123 views

Where to execute domain validation which is not part of domain object?

I'm not sure where to place the following checks I have now in the material domain class. The issue is, that I need to validate that material exists and is valid in external database. Only after that ...
1
vote
0answers
36 views

How to manage data in an Aggregate

This is an overly simplistic example of a domain model for a time keeping domain. I only started on it today as a way to practice the techniques I'm learning while reading Implementing Domain-Driven-...
0
votes
0answers
31 views

Deciding on Idempotency Approach on Distirbuted Systems (At Kafka Consumer)

The service that is built works on requests reply method using Kafka consumers. This service communicates with external systems . Whenever an external system requests a message(via KAfka) They had ...
2
votes
1answer
105 views

Is there a proper way to setup and use fake data in development for a DDD project using DI?

I have a project that has a DD design, and also uses dependency injection. During development, we connect to a test database which contains a former snapshot of production. This works well 95% of the ...
1
vote
2answers
55 views

Where should the code live to update an aggregate root's value based on another aggregate root of the same type

We've got an aggregate root that has a position value so it can be ordered among the other aggregate roots; relative position is something that can change over time. We'd like to have a method that's ...
0
votes
2answers
70 views

Should I create one large initial event or break down in smaller events?

I'm experimenting with event sourcing for an application we haven't build yet. No, I won't implement this without any thought, I'm just experimenting. My domain model looks somewhat like this. The ...
-1
votes
1answer
180 views

Is it logical to use dependency injection in .net core library project? [closed]

Earlier, we serve with web service but we decide to use dll methods. Because served products are on same machine with common database. So we start to create a library with .net core. This library will ...
4
votes
2answers
482 views

Domain vs Entities model? Domain-Driven-Design (DDD)?

In this github, https://github.com/johnph/simple-transaction, under the Transaction.Framework project, there are entities (located at Data/Entities) AccountSummaryEntity.cs AccountTransactionEntity ...
2
votes
1answer
155 views

Correct approach to DDD?

I'm wondering if I'm using the correct architecture in my application. After calling an endpoint in my API, I'm currently going through the following flow: Api.EmployeeController.Update(Api....
0
votes
1answer
33 views

Event sourcing and sync between write and read model

I am creating this project based on event sourcing and cqrs. My write and read model are on different databases (and machines) and are connected through an event bus (in particular I am using ...
2
votes
3answers
218 views

In domain driven design, is a timestamp a property or a value object?

I have some entities and some value objects that need to record the moment they were made. Now I read that a value object is a collection of properties with its own set of rules, and two value objects ...
3
votes
1answer
215 views

Avoiding Repository pattern - implementing Onion Architecture with DbContext only

I am trying to follow the Onion Architecture to design my application where I have the following layers - Domain Layer: is the inner-most layer and defines repository interfaces Infrastructure ...
-2
votes
1answer
79 views

Is a good practice to create Interfaces for use case objects?

Are use case classes (application services on DDD or a.k.a. Facades) stable? Should controllers and listeners be coupled with interfaces at all?
1
vote
2answers
79 views

Is putting an Id to a value object a bad id?

I have a Customer which can have sereval address. Sereval customers can possibily live at the same address. So in my relational database a classic many to many relationship. As : An address can not ...
1
vote
1answer
74 views

Decoupling from third party library

I'm doing a project in PHP and I'm implementing Aggregates and Event Sourcing. In order to avoid coding up all the logic related with ES myself I've decided to use a third party library called ...
1
vote
1answer
104 views

Include Get Password function in User Domain without violating separation of concerns

Problem: I am using a Domain Driven Design architecture and I have a domain model called User as follows: public class User{ public User(string username){ this.Username = username; } ...
5
votes
3answers
408 views

Microservices - What does it mean to deploy & upgrade independently?

In this article, it is mentioned (emphasis mine): ...the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own ...
0
votes
1answer
78 views

How to deal with data that seems to be part of multiple aggregates

My head hurts I've been reading about DDD for years and I've now decided to try it in as pure a form as possible. I'm really struggling in general to define aggregates, but this specific problem is ...
3
votes
4answers
213 views

How to model time dependent invariants?

I have an invariant, something like if I raise one event, then I cannot raise the same event for the same user again for an hour. So the invariant depends on the past and eventual consistency does not ...
1
vote
2answers
98 views

What is a good domain model in this case?

I have a grid of values, something like [ [0,3,1], [0,2,5], [1,0,3], ] I have objects that move on that grid, so they have positions { x: 1.87, y: 1.21 } If we check the upper ...
1
vote
2answers
97 views

Using external services in domain driven design

I practicing DDD concepts on smaller applications and I use to have the same problem when I have to rely on data coming from outside the domain. In a previous project, when I wrote an appointment ...
3
votes
2answers
94 views

Multiple Aggregate Root Updates for Immediate Consistency in DDD

I have a aggregate root named "Project". It has some basic attributes like name, duration, documents. I have another aggregate root named "Task". It also has some basic attributes like name, ...
0
votes
1answer
95 views

Identifying Bounded Context in Task Management

I am currently trying out DDD with a sample application "Task Management System". This is not related to any specific domain as such, it will be generic application which can be used in any domain. ...
0
votes
1answer
63 views

What is the difference between “Abstract Core” and “Pluggable Component Framework” concepts

I am reading Domain Driven Design by Eric Evans and there are 2 sub-chapters - Abstract Core & Pluggable Component Framework - that seems to me to refer to the same concept. I believe that there ...
2
votes
1answer
62 views

Should I use Repositories or wrap that logic in an additional service layer in my Controllers

I am building a Loopback4 app just for learning; I have a scenario where I have to check for a couple of things before sending that request to the database, so my entry point is my Controllers Method, ...
2
votes
0answers
47 views

DDD - Getting access to user email from different domains

Let's assume I was building a collaborative document editing platform ala Google Docs. Collaborators work together on a Document. A Collaborator must be a user of the platform. There's a Comment ...
0
votes
3answers
145 views

Many to many relations in Domain Driven Design

I am new at domain driven design, and want to learn some about aggregates. For example I have a User and Role entities. public class User { public string Id {get; set;} public string Username ...
3
votes
1answer
45 views

should you have separate application service methods for different roles

Say I have a shipping service where I have both a driver and a dispatcher, but there are multiple roles and a user can belong to more than one role. Both the driver and dispatcher roles can mark a ...
1
vote
1answer
113 views

Aggregate root being created by multiple other aggregate roots

I know the title is confusing, I didn't how to word it. I'm studying the Domain Driven Design (DDD) and I'm reading the book "NET Microservices Architecture for Containerized NET Applications" from ...
1
vote
2answers
107 views

How to Validate a Child Object Based on Parent Object's Data

Taking into consideration that I'm making an attempt at Domain-Driven Design and overall good separation of concerns when it comes to business logic, data access logic, etc... Question: How do you ...
0
votes
2answers
126 views

How to send queue messages to one queue in rabbitmq?

I want to use rabbitmq to share domains events between microservices. Due to the fact that queues are round-robin, I need to define one queue per event source and event consumer. For example, cars-ms ...
0
votes
1answer
136 views

Domain Driven Design Validation Logic

I am trying to implement DDD along with Hexagonal Architecture. One of the things that I am struggling with is validations. I had explored a lot of articles on where the validation should be but it ...
0
votes
3answers
57 views

Get the right class in base of an argument - Pattern

I have a little doubt on about get a class in base of an object passed to a function. In my case, I can two different types of object: classA, classB that have the same interface. I have to pass one ...
2
votes
4answers
211 views

Is it a bad practice to query remote resources inside validation?

Watching this talk about Symfony Forms and validation, at 23:06, I got stuck with a doubt I couldn't find a satisfying answer to: Is it a bad practice to execute a query (or a web request, or a side ...
2
votes
2answers
117 views

Different types of account transactions

I'm working on a system where users have different types of 'Accounts' of the financial type. I'm struggling to come up with a design that works. Background A user has 2 types of accounts: A 'tab' ...
3
votes
3answers
302 views

Should an interface be defined in the infrastructure layer if it's only used by an implementing class in that layer?

Overview If an application is being developed following a clean architecture / DDD approach, my understanding is that the application core or domain layer should contain classes and interfaces that ...
9
votes
5answers
259 views

Presentation Layer Accessing Business Logic

I've been reading a lot of material lately about DDD (business entity objects) and other common patterns in n-tiered(layered) architecture. One thing I have issue with is, most articles, blogs, ...
1
vote
2answers
55 views

Event Sourcing - Can a read model/projection be used in business rules within an aggregate?

I know that the general concept behind event sourcing is that the state of the application should be able to be replayed from the event stream. Sometimes, however, we need to get information for ...
0
votes
2answers
148 views

To what extent should DDD be applied - sample cases included

I am trying to understand DDD, but the scope to which we should seperate out domains seems a bit tricky to me. Consider a few cases: 1. Utility Consider I have a utility domain, with 2 helper ...
0
votes
1answer
147 views

Saga vs. Unit of work

What's the relationship between the two? Both are for atomic operations. Both results need to be either success, or failure with rollback to original state.
2
votes
1answer
342 views

Domain classes in DDD structure in React apps?

I'm building an Electron app using React. I'm coming from the C# and WPF world and I'm wondering, where should my domain classes go? I understand the concept of components, but what about a class with ...
2
votes
3answers
184 views

DataAccess Layer coupling with Domain Layer

We have an issue with how the implementation of the Data Access layer (EF6 Includes more specifically), influences the behavior of our Domain layer. A theoretical example to illustrate: Application ...
1
vote
2answers
106 views

value object validation in different use case

I am new to DDD approach and need some advice. I am going to use event site as an example. Say user can create event with start/end date. Event status can be running, expired, closed. Closed status ...
0
votes
0answers
59 views

Is one to one mapping necessary between Write Applications and Read Applications

Introduction: We have a bunch of micro services (about 40) to serve our customers. To facilitate scaling and audit-ability of selected few micro services we have decided to redesign them using CQRS ...
3
votes
1answer
68 views

Event Sourcing Aggregate Roots - Interaction between aggregates and reconstitution

I have been doing a lot of reading/watching on event sourcing but some things still do not quite make sense. My application is a warehouse management system where we have: Deliveries of stock into ...

1 2 3 4 5 23