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

Identify Domain Entities for a search tool interface - Clean Architecture

I am pretty new to Clean Architecture / Onion Achitecture, I actually not sure if the 2 terms are exchangeable. So it pretty clear to me, considering is a few days I am reading and study about it. It ...
user avatar
0 votes
1 answer
91 views

How do I identify ways to break apart an Aggregate that has become my entire application?

I am developing an algorithmic trading framework using DDD/event-driven principles. I've decided the following components sit within my bounded context: Data feed -> [Entry Point] -> "...
user avatar
  • 1,119
-1 votes
0 answers
51 views

DDD - Aggregate invariant and how to create required children aggregates

I've recently been delving into DDD resources (books--Vaughn Vernon's--and other online resources) and in my attempt to do two things at once (work on a pet project and apply what I've been learning) ...
user avatar
  • 1
-1 votes
2 answers
53 views

How to make domain objects accessible to MVC controllers and views?

Summary of my question in a short form: How to propagate changes of domain objects upwards without introducing application logic into them? Following 'facts' are based on prescriptions from respected ...
user avatar
  • 25
-2 votes
2 answers
69 views

How to model transactions in a client-side functional DDD?

I'm new to DDD and I would like to clarify some concepts. I'm thinking about DDD in the client-side. The first one is regarding transactions: My understanding is that transactions are a responsibility ...
user avatar
-1 votes
0 answers
50 views

Singletons in Domain Driven Design?

How do I handle "singletons" in domain driven design? I have (for instance) a domain object Account with a property EmailAddress which should be unique. To validate this I need to put all ...
user avatar
0 votes
1 answer
81 views

Are microservices unfit for our domain logic

I work in a software company with a single product, a 25 year old monolith application (1.2m lines of code) handling all HR related data (employments, salary, collective agreements etc.). I've been ...
user avatar
0 votes
0 answers
44 views

parent-child properties value inheritance at runtime/instance

I have 2 entities with a parent-child relation (like a base product and product variants), basically the two entities have the same properties and at runtime (when instantiating the object) if the the ...
user avatar
1 vote
3 answers
134 views

Aggregates and control over children

Let's say you are performing a PUT request on an endpoint for a resource that holds a list of entities. For example, a football team and it's players. It would be fair to say that the list of players ...
user avatar
0 votes
0 answers
75 views

DDD: Where to put business logic with conditionals etc., is it a domain service?

I would think the answer to my question is yes, but I have never really seen it in practice or any OSS project (and links to any OSS sample projects are highly welcome because the typical examples ...
user avatar
  • 119
0 votes
0 answers
47 views

DDD - Communication between bounded contexts

I have two bounded contexts, Store and Inventory. The Store context has the Product aggregate, the Inventory context also have an aggregate called Product. Product is a different concept inside each ...
user avatar
2 votes
3 answers
153 views

How to implement HATEOAS with CQRS?

Let's say I have a CQRS system where my write model contains the business rules. My read model is simply a DTO; it is a collection of properties and "dumb". Now if you were to create a REST ...
user avatar
0 votes
2 answers
58 views

DDD: Where to place a service that transform data our of the domain

I am new on DDD and hexagonal architecture and I am stuck in deciding where to place a very simple piece of code. To code is a simple JWT decode. For SRP reasons, I want to isolate this action into an ...
user avatar
-1 votes
0 answers
46 views

Observing changes in repository

I am developing a messaging application for iOS (although my question is not iOS related). I am using offline-first approach and I am adhering to the clean architecture design pattern. I currently ...
user avatar
0 votes
1 answer
113 views

Clean Architecture: How to decouple the Repository from a CommandHandler?

We are just starting with event driven (and clean) architecture. So far we have two main entrypoints, a consumer (reader from a Redis Stream / Kafka Topic), and an API. As this is almost a modular ...
user avatar
0 votes
1 answer
98 views

Side effect as a common object seems like a bad pattern

Given an auction system, there are several ways to apply a discount to the transaction's final amount, e.g. Special discount for a given seller discount for a given buyer Discount for a specific ...
user avatar
0 votes
0 answers
71 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
40 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
68 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
99 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
2 answers
256 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
76 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
139 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
100 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
66 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
210 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
142 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
158 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
209 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
99 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
71 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
145 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
395 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
116 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
121 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
213 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
341 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
124 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
128 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
339 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
137 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
101 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
154 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
168 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
199 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
103 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
130 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

1
2 3 4 5
29