We’re rewarding the question askers & reputations are being recalculated! Read more.

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
4
votes
2answers
927 views

Domain driven design project structure [closed]

I have recently started reading about domain driven design and most of the places it's explained or discussed more in conceptual terms. Being a design philosophy it helps to understand the concepts ...
2
votes
0answers
42 views

DDD - Translating Ubiquitous Language Vocabulary Across Bounded Contexts

One of the guidelines around building ubiquitous languages is that there should be one per bounded context. In a domain that has more than one bounded context, and therefore more than one ubiquitous ...
0
votes
0answers
56 views

Two JPA read/write Entities vs SpringJdbcTemplate for implementing CQRS without event sourcing?

So we are trying to implement DDD and CQRS (without event sourcing). I am need of clarity about the implementation details (Spring + JPA). DDD with multiple small aggregate roots require @Entity ...
0
votes
2answers
176 views

performance suggestions on Aggregate root containing thousands of child entities

I understand that DDD is a design concept and implementation through ORMs are tricky but help me understand how would you solve this problem? So here is my confusion on changing on aggregates only ...
0
votes
1answer
61 views

Can Aggregate shared between services?

I am working in an event-sourcing architecture and while creating the aggregates I came to an interesting challenge, disclaimer I'm new to this. I have a UserAggregate encapsulating the logic for ...
0
votes
1answer
166 views

Modify a property of an aggregate's entity

Suppose I have a house-lending service, like Airbnb. I have a House entity, which can have a name. There's also the Reservation entity, which has a start date, an end date, and a name (which isn't ...
1
vote
1answer
95 views

Are separate controllers used when adopting full scale CQRS?

I understand there are three flavours of CQRS: 1) Separate models only i.e. a domain model and a read model. 2) separate models and repositories. 3) Separate models; repositories and physical ...
0
votes
0answers
141 views

DDD: aggregate root and references to child entities

I'm struggling a bit to grasp all DDD concepts and apply them to a real project. Let's say I have the following domain concepts: Car: a vehicle moving inside an area Path: a journey made by a car, ...
1
vote
1answer
258 views

Domain Driven Design - updating part of aggregate

I'm playing around with DDD in a node.js project and struggling with updates to child entities from the aggregate root. For the sake of example, let's say I have two domain objects where Event is my ...
0
votes
1answer
195 views

DDD & composition

I have a project to build, which has the following requirements: topup a wallet by paying money in exchange for credit; this has also the constraint of needing an approval from the finance team, if ...
4
votes
2answers
582 views

Synchronization of data across microservices

We have 2 to 3 dozen microservices that serve our customers. These services are deployed in a Kubernetes cluster, and they're only accessible to the outside world through 3 or 4 API gateways. We ...
0
votes
2answers
127 views

Can a query handler (not repository) access a web service?

Say I have the following class, which maps to a database table: public class Person { public Guid Id {get; set; } public string Name {get; set; } public DateTime DateOfBirth {get; set; } public ...
0
votes
0answers
177 views

DDD: How to (mass) update aggregate roots?

I want to (mass) update aggregate roots with data from a leading external system. To do so a scheduler runs a task which fetches updates for my existing objects and data for new objects from the ...
1
vote
4answers
132 views

How do you domain model “arithmetic business types”?

What are best practices for modeling "arithmetic business types" like money or time? Is it recommended to make classes with explicit plus/multiply operations? Should there be a class for every ...
0
votes
1answer
180 views

How to maintain consistency on write when using Event Sourcing on a Banking System

We have a system that holds credit balances, and we thought event sourcing would be a good fit. Getting the current balance by reading from an eventually consistent projection works. However, I ...
3
votes
1answer
192 views

DDD / Onion architecture in JavaScript

One reason I like .NET is because the 'solutions' and 'projects' lends themselves to good architecture. Good architecture makes it easy to follow the happy path of Domain-Driven Design. I've fallen ...
0
votes
0answers
304 views

EventSourcing / CQRS Implementation with ASP.NET Core WebApi and Azure Cosmos DB

I was looking for an easy implementation of the Event Sourcing and CQRS Pattern in ASP.NET Core using Azure Cosmos DB as Event Store. As I couldn't find anything appropriate I decided to write a ...
4
votes
3answers
187 views

How to model User behaviour that can be shared between microservices in Event Driven architecture?

I have an Event Sourced system that has 3 micro services (simplified): User management - Registering a user, change password etc User account - manages debiting/crediting of the user account balance ...
44
votes
8answers
8k views

Is domain driven design an anti-SQL pattern?

I am diving in the domain driven design (DDD) and while I go more deeply in it there are some things that I don't get. As I understand it, a main point is to split the Domain Logic (Business Logic) ...
1
vote
2answers
136 views

CQRS and Transactional Event Sourcing, problem while recreating Read DB

I'll first explain the context of my problem. The backend of my current project is using DDD, CQRS and Event Sourcing as a stack (the read DB being a MongoDB, my write DB being an event store). At ...
3
votes
1answer
237 views

CQRS - Business Logic in Query Side

I am working on handling authorization for an application. I need some way for a command handler to ask the Authorization bounded context "Is this user allowed to perform this action?". User account ...
1
vote
2answers
619 views

How to structure files for API versioning?

My first time trying to implement API versioning here, and I need some guidelines on how to do it... I know there are many ways of doing API versioning. I'm already decided on doing it by uri (i.e, ...
1
vote
1answer
82 views

Knowledge-based authentication using Domain-driven Design in C#

I previously asked this question on Code Review but was told this was 'off-topic' so I am trying it here. I hope someone can help guide me. As part of an insurance claims system we have created, the ...
0
votes
1answer
227 views

DDD: Aggregate with nested childs

I have a CategoryClass (Aggregate root) -> SubCategoryClass -> and now a relational entity (n-n). Category (root) 1->N SubCategory 1->N SubCategorySlotType (n-n) SlotType (root) My SubCategory only ...
0
votes
1answer
277 views

Composite DTO or flattened DTO?

I'm having problem deciding which of these 2 structures to use from my DTOs: Option 1 is: @Data class Lines{ private final Line[] lines; } @Data class Line{ private final String[] specifiers; ...
4
votes
1answer
149 views

Efficient techniques to make a clean rename of a Ubiquitous Language term (DDD) throughout codebase

The problem A famous quote says: "There are only two hard things in Computer Science: cache invalidation and naming things" We all know how important ubiquitous language / good names in DDD are. I ...
0
votes
0answers
36 views

How many exchanges when using scatter gather and CQRS?

I am trying to learn more about CQRS and enterprise integration in my spare time. I have created an application, which uses CQRS and the Scatter Gather Pattern. There are two web APIs for the CQRS ...
2
votes
1answer
228 views

DDD accessing reference values in Domain layer without repositories

So I have built a domain model and some logic into that. I have created two repositories for two aggregate roots. My question is how to access to the reference data from these layers?. For example, ...
1
vote
3answers
215 views

URL friendly id from DDD entity id

I am currently learning DDD and having a hard time wrapping my head about how to implements URL friendly ids for a web application. From my knowledge, in DDD it is common practice to use UUID as ...
0
votes
2answers
85 views

Bounded contexts and departments within company

We are working on several products as the IT department and we try to provide solutions for different departments within the same company. The core of our business is insurance and the main goal is to ...
3
votes
0answers
74 views

How should domain model entities expose information about the current state of their properties?

I'm new to DDD, so please bear with me. I am trying to design a domain model around an extremely large and complex existing system, where most of the current "domain" logic is either in the UI or in ...
3
votes
0answers
41 views

Can the read api receive events that the write api does not receive or raise?

Say I have a read API and a write API: MyApp.Write.api MyApp.Read.api Both API's handle integration events from other apis/microservices. Say I had certain integration events that only need to be ...
0
votes
1answer
34 views

Updating a Bound Context in One Database From A Master Database

Let's say I have two domains: Customers and Jobs. Customers is responsible for knowing what customers a user has access to. Jobs is responsible for knowing what jobs a user has access to (by ...
1
vote
2answers
92 views

Transforming one collection of objects into a separate unrelated collection?

Say I have a customer class class Customer(name, age) somewhere in my code, I have a list of customers List[Customers] at some point, I need to transform this list of customers into a Map with ...
2
votes
1answer
745 views

CQRS command that needs to work with multiple aggregate roots

I have have a business process that receives an order request which also includes full customer information. In the cases where the external customer ID from that order request is not found in our DB,...
1
vote
1answer
383 views

DDD many-to-many relationship on single entity

To provide a bit of context, the system I'm working on is a football database. A Squad has a collection of Rivals. Arsenal (Squad) has Tottenham and Chelsea as rivals, where Chelsea has Tottenham and ...
-3
votes
1answer
128 views

How to name the function of a thing differently than the thing itself?

A sensor identified by the serial number “ABC1234” fulfills a measurement function identified by the name “Pressure sensor 7” in a production facility. Within the production facility, nobody cares ...
2
votes
1answer
265 views

A problem with understanding aggregates and aggregate roots in Domain Driven Design (DDD)

I've stumbled upon a problem: "I can't split my domain models into aggregate roots". I'm a junior developer and novice at DDD. I really want to understand it, but sometimes it's really confusing. ...
2
votes
1answer
229 views

DDD Aggregate with Catalog Product

I'm new to DDD and I'm trying to figure out the aggregate root. I'm sure this question has been asked a million times. So I have : Products (thousands) Catalogs (hundreds) CatalogEntries that ...
0
votes
2answers
109 views

Data Replication Across Microservice Domains

One of the architectural challenges we are facing on a project is ensuring data consistency over our microservice domains. We have two rules that we are trying hard to enforce: 1. Services cannot ...
2
votes
4answers
710 views

How to adapt Clean Architecture to a rich desktop application

I'm just learning about clean architecture and I'm trying to design a proof of concept for an application I want to build soon. In the Clean Architecture the Presentation layer and the Domain Model ...
0
votes
2answers
156 views

ValueObject - too wordy?

So, I'm having some value objects in my domain, and when I'm using them in one of my builders it looks like this: .withSomething(Id.of(123), Specifiers.of(MySpecifier.of("233"), MySpecifier.of("23423"...
0
votes
0answers
208 views

Separating models in a Backend-For-Frontend (BFF) API

At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some ...
3
votes
5answers
844 views

DDD/OOP - saving Aggregates without ORM. Public getter, reflection, or injecting repository?

So for DDD folks there, Aggregate Roots are supposed to contain business logics only and exposed what is needed only. In DDD Red Book by Vaugh Vernon, he used LevelDB and Hibernate as examples. ...
12
votes
6answers
1k views

DDD meets OOP: How to implement an object-oriented repository?

A typical implementation of a DDD repository doesn't look very OO, for example a save() method: package com.example.domain; public class Product { /* public attributes for brevity */ public ...
0
votes
1answer
828 views

Confused about commands, domain events and external events in event sourcing

I'm a little confused about commands role in event sourcing distinction between domain and external events If my understanding is right a command represents an action initiated by an actor in terms ...
7
votes
8answers
790 views

How to handle business rules that are “uniqueness” constraints?

In a hypothetical system that handles adding users, there are several business rules. Some of the rules can easily be checked in the model. For example a user registration can only be saved if they ...
0
votes
2answers
612 views

DDD - Modifying multiple entities under multiple aggregate roots

In our domain we have a concept of billable activities that get logged by a user. The modeling is pretty straightforward -- the User is an aggregate root, with the Activities being a collection under ...
2
votes
1answer
299 views

How to document the outcome of an event storming session

It's been a long time since I was first introduced to Event Storming in a DDD workshop. More recently we decided to apply it in practice and we have planned our first sessions with a facilitator (...
0
votes
1answer
363 views

CQRS with an Event Log and without Event Sourcing

I am trying to understand the difference between an event log and event store in the context of event sourcing. A really nice explanation I found is that an event store is the single source of truth ...