Questions tagged [domain-driven-design]

Domain-driven design (DDD) is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts. Note that conceptual DDD questions are better to be asked at softwareengineering.stackexchange.com.

Filter by
Sorted by
Tagged with
1 vote
0 answers
8 views

How can you model a complex type in multiple abstract dimensions?

Background I am trying to use the style of functional DDD laid out in "Domain Modeling Made Functional" by Scott Wlaschin. One particular point of interest to me is the concept of breaking ...
0 votes
0 answers
9 views

Domain Driven Design: architecture for a game unclear

I want to develop the backend for a card game app and have the following "objects": Deck Pack Card User It's not really a game but rather a question collection. The relationship between ...
  • 1,001
0 votes
2 answers
18 views

DDD strategic design vs global dictionaries

Do global dictionaries like countries (codes/names) or currencies (code/names) belong to certain domain in DDD or may be shared as common lib/seperate module of application layer? From one side DDD ...
0 votes
0 answers
15 views

DDD: how do you deal with cross-domain joins?

I have a following situation: I have one domain called Books, where we keep books, authors, genres and etc. I have another domain called Invoice, where a user can order a book from the store. Invoice ...
  • 2,416
0 votes
1 answer
20 views

How to join IdentityUser in my custom class CreatorId

I have following class public class Comment : FullAuditedEntity<Guid> { public string Text { get; set; } public Guid PostID { get; set; } public IdentityUser Creator { get; set; } } On ...
  • 331
0 votes
1 answer
35 views

UseLazyLoadingProxies with EF core loads whole list when adding a new child entity

I'm using UseLazyLoadingProxies with EF core, postgresql and DDD architecture. I have Parent and Child objects lets say they look something like this: public class Parent { public int Id { get; ...
0 votes
0 answers
22 views

How to update a property based on Modification of OwnsOne Table in EF Core

I have two classes: public class Lead { public Guid Id { get; private set; } public EA EA { get; private set; } = new EA(); public dateTime UpdateDate { get; set; } } public class EA { ...
  • 4,258
0 votes
0 answers
20 views

Semantic understanding of unit and integration tests in Axon-based applications

As we know Axon has its own tools to implement tests. In documentation we can see example with flights like: FixtureConfiguration<Flight> fixture = new AggregateTestFixture<>(Flight.class);...
-1 votes
1 answer
23 views

What is the better approach for creating folder structure on a DDD project

I always use the same folder structure for all my domain-driven projects: entities - UserEntity.ts - OrgEntity.ts repositories - UserRepo.ts services - (and so on) But I always wonder if it's a ...
0 votes
0 answers
22 views

Upload/Download attachments flow using DDD and .NET

I'm designing Agreements system. Each agreement can have multiple attachments and I want to achieve it in Restful and DDD manners. public class Agreement : AggregateRoot { public Guid Id { get; } ...
  • 224
-1 votes
0 answers
30 views

Display child entities of a root aggregate

I am learning domain driven design and I am a bit confused. I am making a world cup domain where I have NationalTeam, Match and GroupStage classes. I decided that GroupStage will be my aggregate root ...
2 votes
2 answers
67 views

How to map database entity to the domain entity in DDD

I faced the issue of mapping the database entity to the domain entity in DDD. Here are the details (simplified). Domain layer with domain aggregate (entity) and the interface for the repository of ...
0 votes
1 answer
44 views

Identifying Missing or Redundant Classes in Domain Model

I am currently working on a school assignment that requires me to identify missing or redundant classes in a domain model based on a given scenario. Unfortunately, I am having some difficulty with ...
-2 votes
0 answers
21 views

Modeling Data Relationship with Diagram

I found this diagram while reading Google Calendar API document. I understand some part of it like "User can have many calendars, Calendar can have many Users" but what is that dash, double ...
0 votes
0 answers
31 views

Flutter - Encountered a Error at an unrecoverable point. Failure was:

I'm quite a newbie into the flutter_bloc and I got stuck for a couple of weeks with this issue and I didn't figure out how to solve it. The problem that I have is that The BLocBuilder from AddressView ...
  • 15
0 votes
1 answer
32 views

DDD - Passing Aggregates?

I'm working on a project, and desiging some aggregates. I have a User aggregate that has an address. The user must have a mailing and physical address, so there are some rules behind removing and ...
  • 1,068
-1 votes
1 answer
33 views

How far to push the SOLID principles in an app following DDD philosophy [closed]

I'm working on a domain-driven design PHP application that will last for years and that will have many modifications and new features. This is the first time I am developing trying to follow the ...
0 votes
1 answer
33 views

In DDD, how do I bypass my business logic to reconstitute an aggregate in my repository?

When I instantiate an aggregate in my repository, I need to add a lot of dependent objects. (Aggregates are collections of dependent objects.) This creation / addition needs to happen regardless of ...
0 votes
1 answer
24 views

How to resolve Order and Warehouse bounded contexts dependency when eventual consistency is not an option?

I'm working on an order system based on DDD concepts. I'm unsure how to implement the communication between the two bounded contexts Warehouse and Order when eventual consistency is not an option. All ...
  • 307
0 votes
1 answer
22 views

Have to handle an aggregate Id not being present in an event sourced eventual consistent system

I am currently struggling in how to ensure that aggregates are eventually consistent in the case that an aggregate does not exist Lets take I have a order service that deals with creating me an order ...
  • 70
1 vote
2 answers
43 views

Managing transactions in service layer + Clean Architecture/DDD principles

I know there are pros and cons when it comes to managing transactions in the service layer or repository layer. Some people will say to manage them in the service layer, as managing transactions in ...
0 votes
1 answer
32 views

Filtering REST API responses and single responsibility

There is an online casino application that wants to get a filtered list of accounts by game type for a specific player that are available for enrollment winnings based on the request like GET/players/...
0 votes
0 answers
16 views

Where and how to handle authorisation level validation in DDD?

Lets say we have a use-case: "A retailer can allow some of its staff to generate invoices on its behalf, So the invoices can be generated or changed by either retailer itself if the invoice ...
  • 1,607
0 votes
0 answers
13 views

Handle new high level invariant in existing AR (DDD)

Not sure how to handle new requirement for simple AR. To simplify lets map it to well known order example, items of type a,b,c could be sent via shipment types A,B,C,D (not all shipment support every ...
0 votes
1 answer
33 views

Are Actor Model objects the same as domain Entities in an eCommerce system?

Trying to understand Actor Model design. So in general, actor objects should have behaviour, responsibilities, and state that need to be managed and coordinated with other parts of the system. They ...
  • 2,113
0 votes
0 answers
27 views

Hxagonal architecture and DDD with Hibernate and OneToMany relationship

Let's assume I have a project done with hexagonal architecture together with DDD where my domain objects doesn't depend on any JPA implementation. Example project structure looks like below: com....
  • 511
0 votes
1 answer
19 views

Validate based on data in another aggregate root

The short version: Canteen openDays Customer id bookingDays change(newBookingDays){ if (newBookingDays not in >>>canteen.openDays<<<) ...
  • 24.6k
0 votes
0 answers
26 views

NestJs CQRS Event Handler logic

When using NestJS and their EventHandlers - is the idea that the logic to call the other services lives within the module that's emitting events handler? I would have thought there would have been an '...
  • 915
0 votes
1 answer
41 views

Domain Driven Design - Entities

Based on my reading, I understand that entities are more than just models. They represent a domain object and so contain properties, but also can include business logic. In my case, let's say I have ...
  • 14.5k
4 votes
2 answers
56 views

Can a domain event be emitted without being part of an aggregate state change (DDD)

I would like to know how can a domain event be implemented (in DDD) if it is not a natural result of an aggregate's state change. I will borrow the example of this post. So lets say that we need an ...
  • 593
3 votes
0 answers
28 views

Should i return an Aggregate root in Repository?

I'm reading clean architecture. MyEntity extends AggregateRoot. And every time needs to find a record in database, I call repository method to find that, then convert the result to MyEntity, and apply ...
0 votes
0 answers
16 views

Modelling "policy pool"

I am creating a .NET 7 API with EF Core and an SQL Server database where users have a "policy" they can activate and "pool" it, and I need to keep track of when each user's policy ...
0 votes
1 answer
35 views

How to handle related entities in an event sourced aggregate

I'm adventuring myself in the world of ES and CQRS and I've been reading a lot about it. Unfortunately, most materials don't go beyond the basics and when you start trying to apply it to real-world ...
  • 4,373
0 votes
0 answers
47 views

functional domain driven design using typescript

I recently came across an article that seems to provide a really good approach to functional domain driven design using typescript. However, there is one part of the article in particular that I need ...
  • 1,975
0 votes
1 answer
26 views

How to select an aggregate root in EF .net

I'm studying about DDD and doing some tests, I came across the following situation: I have two aggregated entities: https://i.stack.imgur.com/dFpxT.png https://i.stack.imgur.com/Ed3Vg.png According to ...
1 vote
0 answers
68 views

'Object reference not set to an instance of an object' error on .OwnsMany() when creating EF Core migration for multiple Aggregates

I'm building an app following the DDD principles and using Aggregates, Entities and Value objects. These are my two aggregate roots for which I wrote configurations which are then used for building EF ...
  • 141
0 votes
2 answers
48 views

Is it okay to say that entity with one to one relation with aggregate root is not possible in DDD? instead it is a value object or aggregate root?

I am almost new to DDD, i have read books and watch pluralsight video from Steve Smith and Julie Lerman. I am quite confident that i understood the concepts except couple of things that stucked in my ...
0 votes
3 answers
108 views

Get child data by child id through the aggregate root in DDD and EF Core

For asking my question let me explain a bit about this part of the project: Very simple blog system with these entities: Posts - PostsCategories - Categories Post and Category have Many-to-Many ...
1 vote
1 answer
58 views

How to set relationship between entites in clean architecture?

Sample architecture Recently I started to learn Clean Architecture implementation. Now I'm stuck on the way to create my entities and create the between them. It's suggested in uncle Bob to have ...
0 votes
1 answer
57 views

Is consuming your own API necessary in this case?

I have a solution with: ASP.NET Core WebAPI project Blazor Server project (web) I also have 2 Class Libraries Core (domain models and interfaces here) Infrastructure (implementation of interfaces ...
  • 180
0 votes
2 answers
62 views

DDD - Is it alright to change one aggregate and save another one in the same transaction?

My aggregates are: Customer who has multiple Discounts which are invalidated if used during ordering Order which has to be modified if customer who places it has specific discount My problem is that ...
  • 802
0 votes
1 answer
78 views

Is it reasonable to use Int64 instead of DateTime / TimeSpan in the Domain-level structures?

I have the following simple structure in my solution's domain project (.NET Framework): public struct Candlestick { public DateTime OpenTime; public DateTime CloseTime; public double Open; ...
0 votes
1 answer
82 views

DDD: should entities contain or reference other entities?

Let's say I have two entities: Company and Product. They have the following attributes. Company Product Id Id Name Name MarketCap Category Geography Price Here are a few additional facts: A ...
  • 1,001
0 votes
0 answers
28 views

Where do application feature/business logic database settings reside in a DDD solution?

I'm working on rewriting an application with complex business logic. I have decided to follow DDD to do this. I have an Application, Infrastructure and Domain layer in my solution. My application also ...
0 votes
1 answer
39 views

How to access to configuration file from a library layer?

I have a c# project that follow domain driven design. Layers follow like this: API (not library and has startup, config etc.) Application (library) Domain (library) Infrastructure (library) I have a ...
0 votes
0 answers
26 views

How do CRUD-oriented data abstractions in interfaces introduce operational and semantic coupling?

I am going through the book "Patterns for API Design: Simplifying Integration with Loosely Coupled Message Exchanges" and came across this paragraph. I am having a hard time understanding it ...
  • 859
0 votes
1 answer
42 views

DDD with nested entities

I'm trying a project using DDD. I'm confused on how to proceed. Here is a sample of my Entities. Tried to keep it brief. But I'm struggling with the following 1. Update an address on a Person - there ...
  • 1,068
4 votes
0 answers
97 views

Domain Events vs Event notification vs Event-carried state transfer ECST in event driven architecture, implementing Domain Driven Design (DDD)

I would like to clarify in my mind the way different kinds of events could be implemented in a EDA system (system with Event Driven Architecture) implementing DDD (Domain Driven Design). Let assume ...
  • 593
0 votes
1 answer
40 views

How to Use Contains a vlaue object type in DDD repository?

I have a project that is designed with pattern Domain Driven Design. But I have a problem in using ‘Contain’ in this design. I have an entity that has a "name" field that is of type "...
1 vote
0 answers
57 views

EF Core Migration error: "Object reference not set to an instance of an object" when migrating two entities

the problem is the next. I have two entities, one called Service and other Owner, if i migrate them separately the process build, and create migrations with no problem. But when i tried to create a ...

1
2 3 4 5
133