We’re rewarding the question askers & reputations are being recalculated! Read more.

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
1answer
32 views

Is it a bad practice to query remote resources inside validation?

Watching this talk about Symfony Forms and validation, at 23:06, I got stuck with a doubt I couldn't find a satisfying answer to: Is it a bad practice to execute a query (or a web request, or a side ...
2
votes
2answers
102 views

Different types of account transactions

I'm working on a system where users have different types of 'Accounts' of the financial type. I'm struggling to come up with a design that works. Background A user has 2 types of accounts: A 'tab' ...
3
votes
2answers
138 views

Should an interface be defined in the infrastructure layer if it's only used by an implementing class in that layer?

Overview If an application is being developed following a clean architecture / DDD approach, my understanding is that the application core or domain layer should contain classes and interfaces that ...
-1
votes
0answers
34 views

How to set boundaries for a microservice

Example : I need to implement a functionality which result to make a search system that will display result ( StackOverflow system, you are searching for a question then you look at the topic )to the ...
9
votes
5answers
222 views

Presentation Layer Accessing Business Logic

I've been reading a lot of material lately about DDD (business entity objects) and other common patterns in n-tiered(layered) architecture. One thing I have issue with is, most articles, blogs, ...
1
vote
2answers
39 views

Event Sourcing - Can a read model/projection be used in business rules within an aggregate?

I know that the general concept behind event sourcing is that the state of the application should be able to be replayed from the event stream. Sometimes, however, we need to get information for ...
0
votes
2answers
126 views

To what extent should DDD be applied - sample cases included

I am trying to understand DDD, but the scope to which we should seperate out domains seems a bit tricky to me. Consider a few cases: 1. Utility Consider I have a utility domain, with 2 helper ...
0
votes
1answer
119 views

Saga vs. Unit of work

What's the relationship between the two? Both are for atomic operations. Both results need to be either success, or failure with rollback to original state.
2
votes
1answer
114 views

Domain classes in DDD structure in React apps?

I'm building an Electron app using React. I'm coming from the C# and WPF world and I'm wondering, where should my domain classes go? I understand the concept of components, but what about a class with ...
2
votes
3answers
159 views

DataAccess Layer coupling with Domain Layer

We have an issue with how the implementation of the Data Access layer (EF6 Includes more specifically), influences the behavior of our Domain layer. A theoretical example to illustrate: Application ...
1
vote
2answers
89 views

value object validation in different use case

I am new to DDD approach and need some advice. I am going to use event site as an example. Say user can create event with start/end date. Event status can be running, expired, closed. Closed status ...
0
votes
0answers
53 views

Is one to one mapping necessary between Write Applications and Read Applications

Introduction: We have a bunch of micro services (about 40) to serve our customers. To facilitate scaling and audit-ability of selected few micro services we have decided to redesign them using CQRS ...
3
votes
1answer
50 views

Event Sourcing Aggregate Roots - Interaction between aggregates and reconstitution

I have been doing a lot of reading/watching on event sourcing but some things still do not quite make sense. My application is a warehouse management system where we have: Deliveries of stock into ...
1
vote
2answers
65 views

Sorting a list of aggregates based on associated aggregate's properties

I am modelling a users management system, where users have a country of residence. I have modeled both User and Country as aggregate roots, and I am referencing the user's country by its ID internally....
0
votes
1answer
70 views

Designing a system which can use business rules to determine whether there is a difference between two versions of an entity

I'm trying to design a system which can determine whether there is a difference between a field or not given two objects. In my tool, we get multiple versions of the same title, with minor ...
2
votes
1answer
69 views

How to create large readonly entities in DDD?

I have an entity with around 20 properties. Following DDD, I want to make setters private and allow mutation only through methods, since there are some rules I have to check. But how should these ...
0
votes
1answer
50 views

How to determine aggregates when entities are shared?

So I'm trying to figure out exactly what my aggregates/aggregate roots are in my structure, and can't seem to wrap my head around it. Database contains the following tables: SALESGROUP ID ...
0
votes
0answers
73 views

DDD Monolith eshop architecture based on multiple BoundedContexts Question

I´m creating my first eshop / CMS based on DDD / CQS concepts. I want to create application using BoundedContexts separtion as modular monolith at the first stage and maybe latter extract some BC as ...
1
vote
1answer
128 views

Reducing the code duplication between read and write application in CQRS

I am building an application and trying to embrace Domain Driven design principles, CQRS and event sourcing. We are having two applications one for reading and another for writing. The write ...
1
vote
2answers
75 views

Does references between entities of the same aggregate hurt the Aggregate Pattern from DDD?

Consider an application being implemented following Domain Driven Design. In the same aggregation, there are Car and Computer entities that should have a one to many relationship between them (Car ...
1
vote
1answer
53 views

ES/CQRS: How to access additional information in projections

I'm developing an event-sourced/CQRS application and do not understand the best strategy to use when building the read model projections when additional domain data is needed. A partial representation ...
2
votes
2answers
113 views

Dealing with property-level permissions in DDD and should UI or authorization influence the domain model?

Suppose I have a command like below: public sealed class UpdateExampleCommand { public int Field1 { get; set; } public string Field2 { get; set; } public bool Field3 { get; set; } ...
-2
votes
1answer
44 views

How to safe Consistency in DDD project in single aplication?

I want to design my project in DDD spirit. This is single aplication (not microservices) but with separate BC (as modules). Each BC have separate mongoDB collection. I have problem with communication ...
2
votes
0answers
43 views

Commiting transaction in the repository instead of the application service

After quite some time thinking about it, and testing both methods, I'm really struggling with choosing the right manner to commit my transactions. To shape the context, we are in the context of ...
1
vote
1answer
74 views

Bounded contexts and domain-wide public REST API

I'm prototyping out an application here where I'm using domain-driven design to identify the domain(s) of the application and I've ended up with something that - at least so far - feels like a fairly ...
0
votes
1answer
56 views

if two entities need to be created at the same time does this make them a DDD aggregate

Scenario I have a Customer and a CustomerSettings object. When I create a customer I also need to create their CustomerSettings object. These settings can dictate the customer experience immediately ...
0
votes
0answers
19 views

AWS SAM model for calling DDD functionality

I'm working my way through learning and implementing DDD. My domain is a ROI Calculator. I have an event store in place saving all the events that can happen with ROI Calculator. An instance of ROI ...
1
vote
1answer
72 views

Depend on DDD Entities or Interfaces?

My understanding is that the dependency inversion principle does not apply to entities, because entities basically are your application - it generally doesn't make sense to swap out a different ...
2
votes
1answer
37 views

How specific should administrative compensating events be in a CQRS/ES system?

Are there any best practices around how specific to make events that are generated administratively, say to clean up after one-off operational issues? For example: Say you have a credit card ...
3
votes
3answers
163 views

How to deal with UI data requirements in DDD

I'm using DDD and a CQRS/Event Sourcing architecture so my domain logic is separated in a microservice (e.g: command service) and the read side is in another microservice (e.g: query service). We ...
1
vote
1answer
90 views

OOP: Interface design when having objects embedded in parent classes

During the design of a small app I ended up with two possible design alternatives that both would work but, somehow, I feel one could be better than the other in terms of following OOP Principles, ...
1
vote
2answers
137 views

OO Design - Encapsulation question

Scenario Let's say that there is an entity in my domain called Shop. As a shop owner (user), I am able to create rewards that customer users will be able to exchange. It also could be possible to ...
0
votes
3answers
130 views

Aggregates and Tenant Ids

For multi-tenant systems, Vaughn Vernon suggests the tenant id should be on the domain entities. This doesn't seem right to me. The tenant id has no business meaning (with the exception of an ...
-3
votes
2answers
138 views

What is DDD's concepts mapping to microservice's concepts? [closed]

DDD concepts: Domain, Aggregate, Entity, Value object, Bounded context Should every aggregate be a single microservice and have a single DB ( since every microservice should have a single specific DB)...
2
votes
1answer
67 views

Does Domain-Driven Design apply to a component in a system?

I'm new to DDD. From my current understanding and from the examples I've seen in books or articles, DDD addresses the design of a software system to solve a complete domain problem. So it figures ...
2
votes
4answers
130 views

Design an entity with multiple representations (depending on the context / use-case)

Scenario Let's say there is a Shop entity in my app. And two types of users: a Customer and an Admin. When a customer buys anything at a shop, that customer's visit is registered in the system (there'...
3
votes
1answer
93 views

The relationship between a Command, Domain Event and Aggregate

I am new to the concept of DDD (with CQRS) so please, bare with me for this moment. I understand what are Aggregates, Entities, Domain Events and Commands but I really have a terrible time ...
1
vote
1answer
163 views

Is it acceptable to invoke business logic inside the repository layer?

I'm learning DDD and I'm wondering if it's ok to invoke domain model logic from inside the repository layer? I don't mean that the business logic exists as part of the repository, merely that the ...
1
vote
2answers
116 views

In DDD can an aggregate also just be an entity?

I'm working on an e-commerce solution and as part of this we have concepts of things like Stores, Currencies, Payment Methods, Shipping Methods to name a few. For each of these, we have an admin ...
1
vote
1answer
71 views

Domain Driven Design - Bi Directional association between aggregates

I've been struggling with modeling something out correctly, the DDD way. The use case is quite simple. You're a User, and you can be part of a Group. So we have a 1 - many between group and users ( ...
1
vote
1answer
86 views

DDD - Hardcoded Ids in Domain Model [closed]

I have a Business Layer, where I have put all the Entities of the Domain Model. Also there are Domain Services, where I put Domain Logic related to n Entities. One entity is : public class ...
0
votes
0answers
38 views

DDD with web api, how to correctly display error messages that caused by domain to the client?

I asked a question about duplicate validation in domain or application layer. Now, I decided to put all the business rules in the domain layer. I have a value object like this, it has a method for ...
-1
votes
1answer
94 views

Should Specification Patterns return IEnumerable, IQueryable, or Expression?

We are implementing Specification Patterns with Domain Driven Design. Company architect also wants us to utilize Generic repository (not my choice). Currently require specification Pattern for Filter ...
0
votes
0answers
92 views

API Class Input and Paging Specification Pattern in Net Core

I was reading following website, and created a PageModel and Specification pattern. Question is should I merge these two for good practice or keep separate? The PageModel will accept following ...
0
votes
1answer
67 views

Enforce invariants spanning multiple aggregates

Good day, Please help me solve the dilemma. I am trying to write an e-commerce engine relying on DDD. Problems associated with two aggregates, ProductType, and Product. Product is a classic product ...
2
votes
1answer
150 views

DDD with web api, validation in domain or application layer?

I saw a lot of discussion, but I don't know how to do it in a real world. I understand that validation duplication in the client and server is needed. But how to elegantly validate in server and ...
0
votes
1answer
129 views

Which Software Layer should hold Pagination Information?

Which layer should hold pagination information? (Page Size, Page Number), Eg say 100 products, 5 product per 20 pages. User can type in API url layer. api/Product?Page=1&Limit=2&ColumnSort=...
0
votes
1answer
158 views

Domain Driven Design: Should Specification Pattern exist in Repository or Application level for Paging?

In Domain Driven Design, should the specification pattern for paging/pagination exist on the Repository level or Application level, or another layer? Trying to see what Eric Evans author of DDD stated....
6
votes
3answers
253 views

Domain-Driven Design: Cross-Domain Search

I have two systems (for sake of example, and orders and an account domain). Their interfaces consist of an api per system (an orders api and an account api). I have a UI that is sitting on top of ...
0
votes
1answer
103 views

Application architecture using CQS and DDD Aggregates

I am working on a microservice architecture using CQS and with domain objects built using DDD aggregates. I am just beginning to learn about CQS, CQRS, Domain Driven Design, so excuse me if what I ...