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 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
2 votes
2 answers
197 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
  • 796
2 votes
2 answers
76 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
  • 161
0 votes
3 answers
502 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
  • 161
-1 votes
2 answers
81 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
89 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
339 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
110 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
167 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
97 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
270 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
119 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
0 votes
1 answer
109 views

.NET: Microservices, Hexagonal Architecture with lightweight DDD - how to avoid leaky abstraction without a major performance loss?

So, I have a whole system built as microservices.On a service level, I'm utilizing Hexagonal Architecture with lightweight DDD (no events, aggregators etc.) I have a service that fetches Users via ...
user avatar
  • 221
0 votes
2 answers
158 views

Explicit Modeling Aggregate Root to avoid State Pattern

In the book Patterns, Principles, and Practices of Domain-Driven Design, chapter 16, entities, Avoid the State Pattern; Use Explicit Modeling has brought the great idea of domain modeling to my life. ...
user avatar
1 vote
1 answer
182 views

How to integrate Third-party Service in Domain Driven Design?

I will use the typical e-commerce system as an example of my problem here. The e-commerce system has bounded contexts like Sales, Shipping, Identity and Access. The Sales could be a core bounded ...
user avatar
0 votes
1 answer
65 views

One read model project/microservice for all other bounded contexts - is it a good idea?

I have three bounded contexts: Users (generic subdomain), Groups (supporting subdomain) and Events (core domain). Basically users can create/join groups, create events within those groups, and sign up ...
user avatar
-1 votes
1 answer
356 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 ...
user avatar
0 votes
0 answers
61 views

Splitting nested entities keeping invariant within aggregates

I'm currently developing message imap-based module in crm app and i'm trying to connect dots using ddd principals. I've started with three main entities, all bound under Account Aggregate: Account - ...
user avatar
3 votes
2 answers
313 views

How to manage data consistency between Bounded Contexts?

The typical example, the e-commerce system. Let's say the Order is in the Sales bounded context. Every Order contains many OrderLine, which stores the ProductId. The Product is in the Product Catalog ...
user avatar
0 votes
2 answers
98 views

DDD and bounded contexts: can a context be mapped in multiple microservices?

Let's suppose that I have two bounded contexts: A and B. In books I'm reading authors will only write "Context A maps into Microservice A". Now I'm working on a project (university ...
user avatar
  • 9
0 votes
1 answer
123 views

Different Aggregate Root States in Domain Driven Design

I have read the Domain Modeling Made Functional book. In the book, the author model the Order in 3 different states: Unvalidated Validated Priced The 3 states have different properties. But it's ...
user avatar
2 votes
1 answer
198 views

Static validator in DDD value objects

I have a value object to hold a user id number as a string. This number has a unique format throughout my domain. So, it's being validated inside the object during instantiation and an exception is ...
user avatar
-4 votes
3 answers
187 views

What are the abstract design patterns in Domain Driven Design?

I want to understand the Domain-Driven Design approach, how it works, and what it includes in its Definition. TLDNR What is the mental framework behind DDD? What are the core components of DDD? How ...
user avatar
  • 224
-1 votes
1 answer
83 views

CQRS Domain Driven Design and single save button

This may be a dumb question, but I don't know how to solve this. I am moving from CRUD to Domain-Driven Design with CQRS. I have seen many DDD examples like this. You could find many more on Github. ...
user avatar
0 votes
1 answer
254 views

DDD, Aggregates and paginate collections (specific case)

I want to apply DDD to a pet project and everything fits perfectly except for one part: aggregates with collections and the need of pagination. I've been researching about how to deal with an ...
user avatar
  • 103
0 votes
0 answers
101 views

Are Hexagonal Adapters implemented Hexagonally?

I have a system implemented using Hexagonal/Ports and Adapters architecture. It's broken into three separate packages, API (driving ports/adapters), Model, and SPI (service provider interface, driven ...
user avatar
  • 2,341
1 vote
1 answer
75 views

What to improve/change and how to move forward with my Event Storming session?

I'm doing alone session with Event Storming for my application that I plan to build with DDD approach later on. Event Storming session is for learning purposes. My application domain logic is rather ...
user avatar
0 votes
0 answers
114 views

How to implement domain driven design on Android

i created some bounded contexts and integrate them, also implemented the API in Spring with the layered Architecture. Now i want to implement it on Android. Also i want to use the recommended MVVM ...
user avatar
  • 17
2 votes
1 answer
384 views

Data validation between microservices

Consider a scenario (in .Net Core world), where a microservice A collects data from external sources and sends this data asynchronously (RabbitMQ) to microservice B (the reporting system) where this ...
user avatar
1 vote
1 answer
68 views

DDD - Many-to-many between aggregates

I have 2 aggregates: Occupation and WorkActivity. An Occupation can have multiple WorkActivity. A WorkActivity can also belong to many Occupation. The aggregate is a basic element of transfer of data ...
user avatar
0 votes
0 answers
27 views

DDD & ES – modeling crossing context between domains

I've been experimenting with DDD, CQRS and Event Sourcing recently as part of a small application I'm writing for my own use. Unfortunately, I'm not quite sure how to play some things out correctly ...
user avatar
  • 1
1 vote
2 answers
229 views

Defining Bounded Contexts using Business Capabilities or Domains?

I am new to Domain-Driven Design. When I was trying to define the bounded contexts of the software, I don't know where to start. After some searching on the Internet, I am totally confused. Some ...
user avatar
0 votes
0 answers
57 views

Aggregate root validation and persistence [duplicate]

I am currently facing a few issues when implementing the logic in one of my Aggregates. Imagine an "Account" aggregate, which has email, password, verified and verificationDate fields (...
user avatar
  • 101
0 votes
0 answers
38 views

Retrieving related information using the repository pattern [duplicate]

I'm currently working on refactoring a project to use the repository pattern, but I'm currently struggling with how related information should be retrieved. Let's say I have a Hotels and Rooms. I have ...
user avatar
0 votes
4 answers
207 views

Should queries in CQRS be designed based on external demand?

I'm working in a microservice application which has some level of coupling between the microservices (some of them talk with each other via rest api - I know it is bad, but it is what it is; also I ...
user avatar
0 votes
0 answers
70 views

DDD Value Objects: when is enough enough? [duplicate]

Where do you like to draw the line for modeling a single value as a Value Object v.s. a primitive? For example if I have an internal order number and a customer order number, would you model them both ...
user avatar
0 votes
1 answer
615 views

Encapsulation of External API in Infrastructure Layer AS Persistence

My question is about DDD, the Infrastructure layer, it's relation to the Domain, and specifically how we can take advantage of the ability to "swap out" one persistence implementation for ...
user avatar
2 votes
4 answers
444 views

How do I avoid tightly coupling one microservice to another microservice's feature that depends on specific views of the first's data?

I've seen this problem in a few different contexts now but I'm not sure what it's called or how to think about it. Suppose I have a service, AccountService, that serves accounts from a database, e.g. ...
user avatar
0 votes
2 answers
263 views

Is putting logic in API gateway common/acceptable in DDD?

Let's use https://github.com/dotnet-architecture/eShopOnContainers as an example. There are CatalogService, BasketService and there is ApiGateway. In api gateway in BasketController there is ...
user avatar
0 votes
1 answer
133 views

DDD+CQRS - Should I always check if the Databases are online?

I'm developing an intranet application and I'm trying to use some concepts from Domain Driven Design (DDD) and Command and Query Responsibility Segregation (CQRS) in .NET Core, with EFCore. But, to ...
user avatar
0 votes
2 answers
321 views

Where to internationalize emails in a DDD application?

I am building an application with ASP.NET Core 5.0 following DDD and the CQRS pattern. I internationalize on the presentational layer but when I send emails I send them in the application layer via an ...
user avatar
  • 21
0 votes
1 answer
69 views

Options for modeling nested/related workflows?

I am working on an application for awarding organizations by the CEO based on a somewhat complex criteria of multiple dimensions. The process consists of 3 nested workflows: Award workflow (opened → ...
user avatar
  • 197
1 vote
2 answers
107 views

How to declare a Id value object?

For some more type safety I wanted to introduce a PageId type in my application. However, I am not totally sure what the best option to do so is. I want the IDs to be GUIDs, so I thought I just create ...
user avatar
-1 votes
1 answer
68 views

Is there an Aggregate per-request or 1 fat aggregate per piece of domain?

My software has an Experiment as the central Entity which contains lots of details about how scientist does what he does. Basically 99% of the functionality happens within the Experiment and there ...
user avatar
3 votes
3 answers
671 views

Importance of loading/saving complete aggregates at once in DDD

In the context of a web application where we handle only one command per request in a stateless fashion, do we always have to load/save aggregates as one atomic unit? Why is it recommended not to ...
user avatar
  • 197
0 votes
0 answers
95 views

Saga / Processmanager?

I'm thinking about this scenario: I can receive customer inquiries by Email. Those inquiries can be sent from existing customers or unknown "customers" - I'll call latter "Leads". ...
user avatar
  • 1

1
2
3 4 5
29