Skip to main content

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
2 votes
1 answer
107 views

How Should Bounded Contexts Interact with a Central Tenant Context in DDD?

I have a question regarding bounded contexts in DDD terms. Let's assume that I have bounded context called Tenant (With Tenant Admin who can create Tenant Member), Library (With Reader, who can just ...
Shadsin's user avatar
  • 29
1 vote
3 answers
138 views

How to tackle synchronizing large amounts of data across services in an efficient way?

I am working at a retailer with a deep catalog of products and we are taking stock of our architecture. Currently, we use microservices, but all product information goes to a service that is getting ...
SeeIfIDont's user avatar
1 vote
2 answers
109 views

DDD Model to handle Localizations

I'm trying to refine my domain model for the internationalization feature, I wanted to get your input on the best approach to structuring Culture and Localization entities following Domain-Driven ...
Hélder's user avatar
  • 121
1 vote
0 answers
89 views

DDD -Can an aggregate consumes its own events?

I'm facing to an issue with my design in DDD with "Always valid Domain Model" principale and eventual consistency. I have an aggregate with several public methods to mutate its state. class ...
Paul Contremoulin's user avatar
1 vote
1 answer
87 views

Is providing a method of a domain entity with a data/ service provider object a bad design?

I have an entity called User, and it has a method to change the user's email address. I'm using a strongly typed object for representing the email address. public class User: BaseEntity { // Some ...
Critical Failure- Core Dumped's user avatar
1 vote
3 answers
108 views

DDD: big immutable item with some references to entity identifiers, should it be value object or entity?

Let's say I have a Mail, this mail have many properties given by the constructor (for example, 10-15 parameters). This mail can't be edited (immutable), the user has specifically requested to send ...
Vianney's user avatar
  • 19
2 votes
3 answers
141 views

Modelling invariants over different aggregates

I am creating a simple Meal Tracking application and want to employ Domain-Driven Design principles. I've stumbled upon a Design problem that I'm not sure how to solve. Here are the components so far: ...
Philipp Murry's user avatar
0 votes
1 answer
112 views

Where to put getOrSave responsibility?

I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one. I want to move it from service because it just clutters up the logic. But I do not ...
DimitrijeCiric's user avatar
0 votes
1 answer
126 views

How to model two bounded contexts with tight coupling between them

Context Hello, at my company we have been working with DDD for some time now. We have a monolith and some services. The bounded contexts in the monolith use HTTP calls to communicate between them or ...
Antonio Gamiz Delgado's user avatar
3 votes
2 answers
192 views

What value does the mediator pattern add beyond dependency injection?

Does the mediator pattern add any value beyond dependency injection? I am encountering the mediator pattern for the first time in context of this sample application, which is meant to demonstrate how ...
jpaugh's user avatar
  • 239
0 votes
0 answers
60 views

How handle foreign keys in bounded contexts inside a monolith?

in my company we have a Django monolithic application. To be clear, we are not looking into moving to micro-services. For the past few months, I have reading and implementing a DDD architecture inside ...
Antonio Gamiz Delgado's user avatar
2 votes
2 answers
150 views

Unique Checks in Aggregates vs Database

I'm new to DDD and wondering what the best practice is to handle simple unique constraints. My application allows for creation of an Item that is named by the user - and this name must be unique ...
Philipp Murry's user avatar
1 vote
2 answers
184 views

CQRS: Multiple entry points for a single command

I’m trying to follow the Clean Architecture and CQRS within an application that, let’s say, create a product. To achieve this, the application has 3 adapters, one for reading a file, another for ...
Vithor Escames's user avatar
0 votes
1 answer
131 views

DDD bounded contexts, shared tables

We're in the middle of writing a new app from scratch and planning to use DDD for this but we're all new to the process and trying to figure things out. The app at its core is a video conferencing ...
PaReeOhNos's user avatar
1 vote
0 answers
95 views

For a refactoring tool, are I/O operations part of the core domain?

I'm working on a refactoring tool that makes necessary adjustments to a Rust project when moving a source file from one location to another. Quick Explanation In Rust, source files are known as "...
verified_tinker's user avatar
1 vote
1 answer
297 views

Is there a name for this API/type design principle? (I think of it as "state hygiene")

When designing types and their APIs, I try to adhere to these simple principles (which vaguely feel like one general principle to me) as much as feasible: There is a one-to-one correspondence between ...
suushikijitsu's user avatar
0 votes
1 answer
99 views

Designing a balance's system in DDD using Event-Sourcing

I'm developing a driving-school application inside which students can reserve lessons by spending credits. Hence, students have a credit's balance. I want to represent this balance using event-...
ancyrweb's user avatar
  • 131
1 vote
1 answer
162 views

Creating a repository for an entity in DDD

My application uses 3 types of User : Students, Teachers & Admins. The User base class serves as a mechanism for authentication, and I've decided for this project to use apikeys (note : it's a ...
ancyrweb's user avatar
  • 131
1 vote
2 answers
82 views

Modeling multiple account types

I'm developing a monolithic application in which 3 types of accounts can live : Admin, Teacher and Student. They all need an authentication mechanism but expand to support various types of operations (...
ancyrweb's user avatar
  • 131
0 votes
2 answers
124 views

Outside-in v. inside-out development in regard to DDD & BDD

BDD advocates for outside-in development because having a clear goal for your code helps you avoid getting bogged down in unnecessary details. It is usually mentioned in the same breath as DDD, but I'...
verified_tinker's user avatar
0 votes
0 answers
120 views

DDD - Managing Relationships between Domain Aggregates

To understand DDD better, I am trying to create the Domain Layer of an online class application. I have a concept of a Student, Tutor and Session. I thought of having one aggregate called Session and ...
Mush-A's user avatar
  • 109
1 vote
2 answers
147 views

Avoid updating multiple Aggregates in Library Application

I am currently analysing the project ddd-library which is really helping in learning designing a system based on DDD principles. However there is one thing I have a problem with. In case of placing a ...
securita's user avatar
1 vote
3 answers
313 views

How can I avoid duplicate annotations when validating both Entity and DTOs?

I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
Marco Pierre White's user avatar
0 votes
2 answers
96 views

cqrs/ddd - What is the point of having informational Data in the write model/aggregate?

I am wondering whether it makes sense to not store informational Data inside the write model database. By informational Data I mean data that is not directly used for any decision making in the write ...
hadamard's user avatar
  • 140
0 votes
0 answers
118 views

DDD - How do scheduled tasks fit in CQRS/DDD

I am trying out CQRS, Event Sourcing and DDD in a project and I want to model a Reminder Service. The context is as follows: Person A creates a Task for Person B and sets a Deadline for Person B to ...
securita's user avatar
-3 votes
2 answers
109 views

Company and person or just contact table [closed]

Given the two models company and person I'm noticing duplicate fields i.e. zipcode, emailaddress for each. Yet, a short research reveals a reasonable popularity for separating those two entities into ...
jjk's user avatar
  • 545
2 votes
2 answers
160 views

Is it ever ok to have mapping logic inside a domain primitive?

We have some domain primitives for representing an Account an Amount with Currency etc. These are in a shared library, so all our microservices can use them. And then we started adding some ...
user1402866's user avatar
0 votes
1 answer
94 views

Authorization business logic on claims or on app database?

Context: I have an API (using DDD) with an entity lets call it "Content" that only can be update by certain users. For example Content with Id = 1, can only be modified by User Id = 1, ...
Danielbahe's user avatar
1 vote
4 answers
477 views

Is validation part of presentation layer or business logic? [duplicate]

We're working on a new project (backend, API), following the "clean code" and "clean architecture" principles (described in Robert Martin's books), dividing our application into ...
LNK's user avatar
  • 119
2 votes
2 answers
756 views

Where to define the interfaces of the infrastructure in a clean architecture and DDD?

I have been reading about clean architecture and following Domain-Driven Design. In all the examples I have found, the interfaces of the repository are defined in the domain. However, it is in the ...
Álvaro García's user avatar
1 vote
2 answers
182 views

DDD: aggregate that contains references to other aggregate root but the aggregate root has specific functionality inside the first

I have an aggregate, let's call it Party. For a party, I can have many People which is an aggregate as well as they can exist on their own without the Party. But specifically for the Party , I want to ...
Gigabit's user avatar
  • 227
0 votes
6 answers
238 views

is employee just a user in domain driven design

Suppose I have an application where I can manage clients (just companies I offer my services to) and what services I offer for them. I also have the functionality to create timebookings, which means I ...
hadamard's user avatar
  • 140
1 vote
3 answers
187 views

In domain-driven design, what is the relationship between the business functions of a system and the subdomains?

Suppose an organization is developing an enterprise assistance and management platform with instant messaging, video conferencing, file cloud, online documentation, process approval, and more. The ...
Ares's user avatar
  • 39
-2 votes
2 answers
218 views

Enumeration in every entity?

According to Eric's definition of entities: "An object that is not fundamentally defined by its attributes, but rather by a thread of continuity and identity" Does that mean apart from all ...
Varun Raj's user avatar
  • 115
0 votes
1 answer
148 views

Shopping Cart Design with SRP: Handling Cart Creation and Update Separately

I'm working on designing a shopping cart system that respects the single responsibility principle. However, I'm facing a challenge when it comes to handling cart creation and updating separately. ...
Thiago Dias's user avatar
-1 votes
2 answers
507 views

Best Practice for Integrating Domain Services with Infrastructure Layer in Clean Architecture [closed]

I'm currently implementing clean architecture in my project. My application includes various types of communication protocols (TCP, HTTPS, etc.) implemented in the infrastructure layer. These ...
Shady Shahin's user avatar
1 vote
1 answer
175 views

Should domain services in a domain-driven design invoke the data warehouse interface?

From what I've read, domain services typically don't import or rely on Repository directly in theory,The responsibilities of domain services focus on handling business logic and coordinating ...
Ares's user avatar
  • 39
1 vote
3 answers
203 views

What are the DDD aggregates in package delivery system?

I'm trying to model a specific domain using DDD techniques and have some doubts. To better contextualize, a brief description: It's a domain of deliveries and delivery confirmation. We have two main ...
Eduardo Albuquerque's user avatar
0 votes
0 answers
70 views

DDD Multi-stage user creation

I'm converting some old MVC/Service code to CQRS/DDD. To create a user, I need to: call an external service to create an account in that system, and retrieve the guid associated with that new ...
Neil's user avatar
  • 137
0 votes
1 answer
201 views

ddd, bulk creation of aggregate and validation that requires infrastructure

I am designing an aggregate that has list of keywords as its property, and it has constraint that two aggregate cannot have same keywords as its property. I use repository that has save and saveAll ...
ringord's user avatar
  • 101
0 votes
1 answer
153 views

DDD concept and bulk create

I'm learning DDD and I have a question. Suppose there is a Graph entity with associated Node and Edge entities, corresponding to the vertices and edges of the graph. A node represents some business ...
Denis Nikanorov's user avatar
1 vote
1 answer
122 views

How does a Bounded Context from DDD help scaling microservices?

New to the microservices architecture - but what I've picked up so far doing some research while designing a microservices architecture for a home rental system is these: Individual microservice ...
dig_123's user avatar
  • 137
3 votes
1 answer
173 views

How to structure repositories for a small number of entities?

I am working on a project implemented in DDD style, and I use Repository architecture pattern to persist domain changes. I have multiple roles in domain layer, and that's what raises my question - how ...
lubitelpospat's user avatar
4 votes
3 answers
594 views

When would you consider sharing a database to be fine? What are your rules?

When would you consider sharing a database to be fine? What are your rules? Our team in-charge of in-store credits. We: Calculate how much credit the customer earned Keep track of how much credit the ...
LostInComputer's user avatar
0 votes
0 answers
32 views

Balancing logic placement in the domain and general perfomance of the system

I am writing my first application using DDD (in Node with TS) and I started writing all the domain first -- before starting the repositories/DB and then the application, while writing unit tests for ...
Bernardo Benini Fantin's user avatar
2 votes
2 answers
162 views

Child Entity or Aggregate Root?

I have to design a part of a system in responsible for creating tickets for attractions and then sell them. Basically there are three different parts: Product: to create the tickets for sale for each ...
Tobías's user avatar
  • 251
0 votes
1 answer
61 views

Validating data and logic outside the domain

I have a budget entity in my domain which can be closed by the user if the budget is open. This means if the budget opens today and closes in seven days, in between this time I can close it, not ...
Bernardo Benini Fantin's user avatar
0 votes
1 answer
135 views

Deriving entities in different domains from one DB table

Let's say I have a table for storing users. In this table, I have data like id, name, address, bank account and birthdate. Also, I have two domains in my codebase; in one of them, I need a user entity ...
Bernardo Benini Fantin's user avatar
1 vote
2 answers
409 views

Is service discovery an anti-pattern?

We deploy microservices in Kubernetes environment. For providing a solution to a business use-case using microservices, Is the idea of service registration and service discovery not an anti pattern? ...
user1787812's user avatar
1 vote
2 answers
173 views

Handle data layer when using DDD

Since March I switched jobs and became the Tech Lead of two teams that work on a shared codebase and a separate codebase for "region" specific implementations. This team works using NestJS, ...
Matias's user avatar
  • 31

1
2 3 4 5
33