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
1 vote
1 answer
75 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
49 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
98 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
92 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
-2 votes
0 answers
38 views

micro-service bounded context applies to infrastructure?

My team own two micro-services, both hosted on AWS ECS. One service uses aws redis. For second service we need to implement lock mechanism for one endpoint. For that we need to store single key in ...
Aniruddha's user avatar
1 vote
1 answer
61 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
0 votes
3 answers
91 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
73 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
69 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
101 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
151 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
61 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
0 votes
4 answers
223 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
  • 109
0 votes
2 answers
207 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
95 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
  • 217
0 votes
6 answers
184 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
158 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
198 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
82 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
298 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
124 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
172 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
65 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
145 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
134 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
95 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
163 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
589 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
30 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
145 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
58 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
98 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
375 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
157 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 vote
5 answers
458 views

When designing aggregates, can a child entity store another aggregate root ID?

I’m currently trying DDD with establishments’ opening hours: OpeningHours is an aggregate root; it ensures its openings don’t overlap an Establishment can be set many opening hours (like summer’s, ...
MatTheCat's user avatar
  • 119
1 vote
1 answer
173 views

How to map domain model object to its http representation?

I have a Post domain model object with the title, body, and author attributes. It is persisted in a datatable with the id, title, body and author_id columns. I have left the ID fields out from its ...
utg.tdawg's user avatar
  • 121
0 votes
1 answer
120 views

Is this way of programming related to DDD?

In my new job, I'm getting a hard time understanding how they want to model things... they are using Domain Driven Design. For example, I come across this kind of code: $userRepo = new UserRepository($...
JorgeeFG's user avatar
  • 669
1 vote
4 answers
170 views

How to Access the Private State of an Entity in the Save Method of its Repository

Consider the domain entity, Order, which can be persisted by the OrderRepository. Orders maintain state that is stored in the database. However, it does not expose all of it directly. That is, parts ...
STHA's user avatar
  • 49
0 votes
0 answers
62 views

Maintaning isolation between modules in Django monolith

In our company we have a monolith. Right now is not that big but we are already seeing some problems with the isolation between the modules we have. Our setup is pretty similar to other Django ...
Antonio Gamiz Delgado's user avatar
1 vote
2 answers
230 views

DDD Logic implementation

Ive been tossing this around in my head for awhile. But I'm working on a project that consists of an Order, that has a OrderStatus. There is quite a bit of logic that revolves around the status and ...
KryptoBeard's user avatar
0 votes
1 answer
103 views

Passing data into Repository via dependency injection

Let's say I have a blog, I use DDD approach, I need to pass an instance of PaginationParameters class to PostsRepository, is it ok to bind DI container to concrete instance of PaginationParameters ...
cool_cat's user avatar
1 vote
2 answers
165 views

What's the connection between aggregate roots and has/belongs to relationships?

In trying to learn DDD by applying it to a new project, I've run into an obstacle. Here's a simplified structure of my very real domain: a project has many components which have many objectives which ...
verified_tinker's user avatar
-1 votes
2 answers
123 views

How to establish the relationship between two root entities from different bundled contexts in DDD?

I have two bounded contexts, one to handle files and another to handled bills. I have two projects, one for each bounded contexts. Files can be any kind of file, an image, a document in pdf or any ...
Álvaro García's user avatar
-2 votes
1 answer
97 views

SERVICES in sending ENTITIES in distributed systems

Here is a passage from the Blue book: Distributed system architectures, such as J2EE and CORBA, provide special publishing mechanisms for SERVICES , with conventions for their use, and they add ...
cool_cat's user avatar
0 votes
0 answers
72 views

Should input adapters receive the domain model?

This article on Medium addresses the scopes of the domain model in hexagonal architecture. I have sketched the following generic hexagonal architecture: On the one hand, the secondary/output adapter ...
user946822's user avatar
0 votes
1 answer
163 views

DDD On Large Scale Applications

Working on DDD lately got me thinking about how it preforms on large scale systems. Watching many tutorials and reading many articles makes it look fun and promising for small projects. I have three ...
Br4infreze's user avatar
-3 votes
1 answer
278 views

I do not like RESTful APIs anymore and dont understand why nobody agrees with me [closed]

Some years ago, every API I developed was a REST API and I did everything to follow the best practices to make them "RESTful". But after some time, I have my doubts if RESTful APIs that ...
David Mason's user avatar
0 votes
1 answer
66 views

Where to store a props type declaration on a DDD project?

I am trying to apply DDD to a Vue project (so it's DDD on the frontend) and I have a doubt as to where store a props type. A Vue component can have props, which is basically named data passed to the ...
Bernardo Benini Fantin's user avatar
0 votes
2 answers
111 views

Where to put factories that depend on the application layer?

I am a frontend developer (currently working with Vue and TS), and I have been searching for better organization of the frontend code and recently I got to know DDD a bit. I know DDD is mostly used ...
Bernardo Benini Fantin's user avatar
0 votes
2 answers
125 views

How to structure a cart with cart products object

I am new to DDD and I am having trouble structuring an object. I have a cart, where I can add products to it. Each product has some properties like image, title, price, etc. Whenever a product is ...
Bernardo Benini Fantin's user avatar

1
2 3 4 5
33