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
0 answers
44 views

How do you map domain driven design planning outcomes to Agile features and stories?

I'm still in my infancy on learning DDD so excuse the question if it doesn't make sense.. The background: My team went through an event storming and also a "Boris-esque" exercise to create ...
user avatar
0 votes
0 answers
68 views

Doubts designing an old system using DDD

We have the following system: References that identify a product and have a family which identifies a group in which the reference belongs. Families that are a way to group references, for example, if ...
user avatar
  • 33
0 votes
1 answer
35 views

Referencing another ARs value object

My domain is a pipeline for processing data and sending it off to another place afterwards. It's defined by these rules: Data is divided into Signals, which have some identifiers (name, category, ...
user avatar
  • 105
-2 votes
1 answer
56 views

Domain Driven Design: ElasticSearch and Postgres together

Let me start by saying my knowledge of microservices isn't as strong as it could be. My understanding of DDD is that we'd draw a bounded context over an entity and that would be our service. How does ...
user avatar
0 votes
1 answer
83 views

Alternatives to DDD - Complicated and cumbersome business logic/process

We have inherited a legacy MS CRM 4.0 application and the business wants it re-written to an as vanilla as possible .NET web application. The business wants to go down this route vs another off-the-...
user avatar
  • 115
1 vote
1 answer
164 views

The difference between Repository and DAO

I am learning Domain Driven Design and I cannot understand the difference between Repository and DAO. It seems to me that they are similar. Their roles and functionalities are the same, but why they ...
user avatar
  • 27
1 vote
1 answer
74 views

Domain Driven Design and Systems Analysts

DDD targets software with complex domains, which is usually the case with enterprise information systems. Traditionally, in the organizations developing this kind of software, there is a "systems ...
user avatar
  • 19
0 votes
3 answers
121 views

How to model Product and Material relationship using DDD

I'm still learning DDD and trying to model in my domain layer a Product that is made by none or many Materials in different quantities. Initially I create two aggregates, Product and Material and one ...
user avatar
0 votes
0 answers
85 views

How to update complex entities in DDD

let's say I have the following aggregate: class Road: company_id: int # another aggregate name: str stops: List[Stop] def add_stop(stop: Stop): stops.append(stop) class Stop: ...
user avatar
0 votes
0 answers
54 views

Domain-driven Design: Aggregate root property is a collection of other independent aggregate roots

In my domain model I've got two principal entities: User and Event, both which I've decided to make aggregate roots. Users and Events have a one-to-many relationship wherein Users can create several ...
user avatar
1 vote
2 answers
164 views

How to update "big" aggregatess in DDD

In my domain there's a part where I have a root entity, with some fields, and then some other entity inside that aggregate, like this: class AggregateRootEntity { ... some fields ... Entity ...
user avatar
0 votes
1 answer
135 views

Unit testing parts that use a Value Object that is being created by a Factory

Here is the conundrum, I have a fairly complex Value Object and I don't want to expose it's internals. It should not be an Entity since there is no need for attaching an identity to it. According to ...
user avatar
  • 3
1 vote
4 answers
151 views

Modelling interactions (Domain driven design)

To use a dumb example, assume that particular users (labourers) can move boxes around. How would you go about representing that in your system in a semantic way that scales. I'm currently inclined to ...
user avatar
  • 147
0 votes
2 answers
202 views

Which strategy to use to create object instances

I have this use case (I've simplified it): Each student can apply for one or multiple activities. As of now we only have Swimming activity onboarded on the system, but we expect to have more. Base ...
user avatar
  • 109
0 votes
0 answers
89 views

How to handle presentation/UI rules in DDD context?

I'm wondering how a rule tailored for a specific UI is handled in a context of DDD and hexagonal/onion architecture? For example, if you have a screen for an inventory app where you can create product ...
user avatar
1 vote
4 answers
121 views

Dilema about having a Country, Province, City model separate Aggregate or in the same aggregate

We are porting an old monolith application and we are trying to apply the DDD concepts, we started looking for what we think are the Bounding Contexts of the application. We have what we thought would ...
user avatar
  • 33
0 votes
0 answers
53 views

CQRS, DDD and batch, CRUD-y operations

How to perform basic CRUD operations (especially batch) by playing with DDD and CQRS? Let's say I have a list of IDs in my controller that need to be removed (soft delete). Currently, I treat this ...
user avatar
1 vote
1 answer
144 views

Implementing shared content in a system with several users

I am working on a system that allows users to track their musical practice. The system allows users to create 'exercises' that store a few pieces of information like name, description and external ...
user avatar
1 vote
3 answers
309 views

DDD - Repository vs Anti-corruption layer

How does the 2 differ in terms of actual usage? In DDD, we use a repository to get Aggregate Roots and persist them. We forget about the implementations and focus on the domain and so it doesn't ...
user avatar
31 votes
9 answers
7k views

Is extracting an interface just for testing purposes a code smell?

I will explain with an hypothetical example. Suppose that my domain is Cars. Everyone around the software, talks about cars. Car is the aggregate root of aggregate roots. For example, CAR table has ...
user avatar
  • 695
0 votes
1 answer
112 views

In a layered architecture with exchangable data providers, how to deal with provider-specific implementation details?

Assume an application architecture with three layers (presentation, domain, data access - though presentation is irrelevant to this question) that follows dependency inversion: The domain layer ...
user avatar
  • 19
2 votes
1 answer
81 views

External dependencies in Domain Driven Design

The application I am working on is written in TypeScript and I need to manipulate DateTime. I always avoid doing date/time calculations manually, because they have a lot of edge-cases. The Date class ...
user avatar
0 votes
4 answers
165 views

DDD Best Practice: should contract DTOs include fields that are not used by the frontend?

Say we have a data grid of car models in our application. In the data grid, many fields were displayed, such as the brand, the model name and the year of production. However there are many more fields ...
user avatar
  • 109
2 votes
3 answers
240 views

How to model 1 to many relationships in DDD (Domain Driven Design)

I think I am struggling to model a relationship between 2 entities. I am trying to do so in a way that promotes DDD and captures business semantics. The following is my business context: I am ...
user avatar
  • 147
1 vote
1 answer
101 views

Where to check for invariants between two aggregate roots?

I have three entities inside one bounded context: Company Department Agent A few business requirements: A company has a list of departments, and a list of available phone numbers. A department has ...
user avatar
  • 668
1 vote
2 answers
126 views

Is it a mistake to distribute shopper data across microservices rather than have its own microservice?

I'm studying DDD and trying to plan how we'll migrate from our monolith to a microservice architecture. At the moment I'm trying to work through two possibilities The first is where the shopper is an ...
user avatar
2 votes
3 answers
283 views

In vertical slice architecture, how can I deal with entities/repositories that are used in multiple slices?

I'm trying to group the components of my system by funtionality. This is the analysis class diagram of my system model. A service class that involves a Post entity might necessarily interact ...
user avatar
  • 299
0 votes
1 answer
118 views

DDD - model and enforce invariants for workflow engine

I'm trying to design a workflow engine using a DDD approach. Context (B1) Assign items to a workflow Invariant: depending on their types, items can only start the workflow on specific steps. (B2) ...
user avatar
0 votes
1 answer
89 views

DDD access to a composite Aggregate across Boundary Contexts

The behavior of my systems, is as follows user places an order for a product 1a. order management creates a placeholder record for the order 1b. forwards the order to an external vendor. external ...
user avatar
  • 11
0 votes
1 answer
94 views

A table contains forbidden words which you cannot use in a comment - is it a value object in DDD? [duplicate]

My aggregate root is "Post" and sub aggregate is "Comment". In my database I have a table called "ForbiddenWords" with one column "Name" (it contains words for ...
user avatar
2 votes
3 answers
150 views

Use abstract factory (or an alternative way) to produce an instance of a subclass?

Context for this question I'm currently working with small data storage media (e.g. RFID tags) that contain some fixed number of bytes that can be manipulated. The drivers that allow reading bytes ...
user avatar
3 votes
1 answer
142 views

Posts and Comments - how should I define them in domain driven design?

I am designing a blog in domain driven design. I don't know how I should define models: Post and Comment. My database: A user can see a post and related comments. So I think that Post model can be ...
user avatar
1 vote
2 answers
146 views

Should domain layer have validation logic? [duplicate]

Let's say I have a User class described as follows: record User ( Guid Id, string Username, string Password ) { /* some methods */ }; Let's say Usernames and Passwords need at the very least ...
user avatar
1 vote
1 answer
91 views

In an effort to design small aggregates, have you tried making every aggregate the aggregate root? You'd need to refactor afterwards, of course

I'm currently designing a DDD system, and it is a reference implementation. The reference is a big ball of mud. I'm finding myself spending a fair amount of time determining aggregate roots and the ...
user avatar
-1 votes
1 answer
127 views

Checking a related aggregate existence is Domain concern?

This is my specific situation: I am following DDD and Event sourcing to implement my application (using C#). I have a Domain layer that contains Aggregates' implementation. I write unit tests for this ...
user avatar
  • 99
2 votes
2 answers
172 views

Maintaining referential integrity between Aggregate Roots

In his book "Implementing Domain-Driven Design" Vaughn Vernon suggests to reference aggregate roots only by ID. I see the following advantages of this approach: It is clear where the ...
user avatar
  • 786
2 votes
2 answers
71 views

Replacing service implementation based on environment variables

I have previously asked a question on this forum linked here. In short, I wanted to not call 3rd party APIs when developing locally. Based on the wonderful answers received I have opted for the ...
user avatar
  • 151
0 votes
3 answers
360 views

Mapping to and from domain entities

I am in the process of implementing onion / clean architecture, and would like to understand better how and when to map to my domain entities. So if we take a specific example where we have a Post and ...
user avatar
  • 151
-1 votes
2 answers
79 views

Transactional and eventual consistency together -- which operations MUST be transactionally consistent?

I find a lot of resources regarding strong consistency versus eventual consistency, and when to choose one or the other. I'm wondering how and when you would have both together. Consider this specific ...
user avatar
  • 15
0 votes
0 answers
65 views

Context Mapping and Open Host Services

I have a question regarding the modelling of bounded contexts and the context mapping. I have to evaluete and document an existing architecture where two bounded contexts are exchanging information ...
user avatar
  • 101
2 votes
2 answers
314 views

DDD - how to avoid the 'God' aggregates?

I'm working on a project which utilizes DDD, Hexagonal Architecture and Microservices. While working on StorageService, the implementation was quite easy since the features were: CRUD of media files ...
user avatar
  • 221
1 vote
1 answer
105 views

Sharing business validation cross Vertical Slices

I’m doing an task based application using Vertical Slice Architecture (VSA) and domain driven design (DDD). Tasks split into commands and queries and using Mediator pattern. Say I’m having an Order ...
user avatar
  • 111
1 vote
0 answers
86 views

(How) should I handle a consistent but unwanted aggregate state?

It's clear that an entity should never be in an inconsistent state; if a change would violate an invariant, a domain object should reject the change. But what if it's left in a valid, but ...
user avatar
0 votes
2 answers
136 views

Adding item to list process in domain driven design?

I will describe the problem in a typical example Todo Application. The user can have many TodoList. A TodoList could have many Todo. The use case is "Add Todo to the TodoList". In this case, ...
user avatar
0 votes
1 answer
90 views

Reconstitute value objects from database

I am using Domain-Driven Design with Railway-oriented programming as an exception handling method. Every value object will not throw an Error, but return a Result type to indicate if it failed or ...
user avatar
1 vote
3 answers
243 views

Value object depends on other value object

As I understand, most of the business logic is stored in the value objects as constraints, like the price cannot be less than 0. But I have a problem where the value object depends on another value ...
user avatar
1 vote
1 answer
111 views

How to create an object requires multiple bounded contexts?

I will describe my problem with a very typical example, an e-commerce application. Says we have to manage Products, and we have 2 bounded contexts Sales, and Warehouse that store the product ...
user avatar
0 votes
0 answers
31 views

Creating entity with external dependency inside the aggregateroot?

Okay, so, I'm working on an AuthService for my microservices system. I'm putting plenty of logic around single instance of User inside of it itself, just so I can avoid repeating code, breaking SRP or ...
user avatar
  • 221
0 votes
0 answers
46 views

SOA: How to fan-in with unknown number of processes

In my event-driven architecture I have a situation where once an event is raised validation needs to occur and I'm wondering how to proceed to the next step in the process if I don't know how many ...
user avatar
-2 votes
1 answer
64 views

Do I need to write Scenarios if I use Event Storming? [closed]

Event Storming is a great method to understand the business processes. Scenario (Use Case Specification) also describes the business process. They both do one thing. But when documenting, the Event ...
user avatar

1
2 3 4 5
29