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 ...
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] -> "...
-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) ...
0 votes
2 answers
136 views

Obtaining application generated ID from repository or from entity constructor?

In the Book "Implementing Domain-Driven Design" the author suggests to implement a repository method to provide the next application-generated (not database-generated) ID. Like so: class ...
-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 ...
0 votes
5 answers
6k views

Why is an interface used rather than inheritance?

Please see the Rules Design Pattern on this webpage: http://www.michael-whelan.net/rules-design-pattern/. It has classes like this: public interface IDiscountRule { decimal ...
0 votes
2 answers
201 views

Collect Data of different Modules inside a Monolith

During my first attempt of implementing a project with the "Clean Architecture" I try to implementation a job portal where I came across a problem concerning the communication between (...
-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 ...
0 votes
2 answers
601 views

How to design an API wrapper with bulky operations on domain object? (Need guidance)

I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible. Context: We have a project which supports certain file operations like edit, ...
-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 ...
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 ...
1 vote
2 answers
378 views

Entity Framework and Domain Driven Design Testability

I'm using a DDD approach for the Domain classes. Although, I have a problem on my design, that I'm handling it now but didn't have a good idea to over tackle it. My Architecture is the follow one: - ...
4 votes
1 answer
465 views

Applying Domain Driven Design - Model/Implementation

I'm quite new in the DDD-World and I'm just trying to figure out all the basics so please bear with me! I have the following Entities: - Datamodel - Object Types - Object Fields A datamodel can ...
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 ...
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 ...
0 votes
1 answer
1k views

DDD Including DB Id in domain entity

According to the book, The domain layer should be isolated. In domain entity, you should avoid adding a property represents database PK (usually identity surrogate column called ID). There is no ...
1 vote
1 answer
281 views

Can Domain Services publish Domain Events on multi-aggregate operations?

I'm in a scenario where, when a certain command is applied on an aggregate, I have to change the state of the aggregate itself if ALL related aggregates are in the same state, then notify the world ...
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 ...
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 ...
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 ...
4 votes
2 answers
458 views

Domain Events Grouping/Buffering

Suppose I have 3 domain events, Event1 Event2 and Event3. When command arrives at my Service Layer, I can rise 2 commands at the same time - e.g. Event1 and Event2. One Class has event listener for ...
2 votes
2 answers
278 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; } ...
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 ...
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 ...
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 ...
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 ...
-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 ...
7 votes
3 answers
2k views

Balance between aggregate boundaries and domain consistency in DDD

Designing an Aggregate and choosing an Aggregate Root getting tricky for me all the time especially when it comes to ensuring right transactional contexts and consistency constraints so I'm wondering ...
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 ...
2 votes
3 answers
791 views

DDD loophole when one aggregate operation depends on state of another aggregate

I have found interesting problem in DDD, which can be solved extremely simply without DDD, but with DDD looks huge. Let's say I have: Category - AR (AggregateRoot) Product - AR Category can have ...
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 ...
0 votes
1 answer
301 views

Identifying Bounded Context in Task Management

I am currently trying out DDD with a sample application "Task Management System". This is not related to any specific domain as such, it will be generic application which can be used in any domain. ...
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, ...
-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 ...
3 votes
3 answers
1k views

Define multiple DDD events or just one XXXChanged event when using CQRS?

Is it preferable to define a single 'container event' like below: trait UserStatus case object Active extends UserStatus case object Inactive extends UserStatus case class UserStatusChanged(...
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 ...
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-...
-1 votes
1 answer
355 views

Where should the user access bounded context stands in DDD and Clean Architecture?

I have seen some Bounded Context examples to learn DDD. In those examples, the User Access bounded context (register, login, authorization...) is considered a generic bounded context and could be a ...
15 votes
2 answers
9k views

Is there an elegant way to check unique constraints on domain object attributes without moving business logic into service layer?

I have been adapting domain-driven design for about 8 years now and even after all these years, there is still one thing, that has been bugging me. That is checking for a unique record in data storage ...
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 ...
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: ...
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 ...
3 votes
1 answer
694 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 ...
1 vote
1 answer
718 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
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 ...
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 ...
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 ...
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 ...
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 ...
1 vote
2 answers
2k views

Modeling on Domain Driven Design and C4Model

I am wondering how DDD and C4Model can play together. Level 1 of Simon Brown's c4 Model is System Context diagram. So I think after you find and define your Bounded Contexts, you may start creating ...

1
2 3 4 5
29