aggregateroot

DDD Which is the root Aggregate root?

北城以北 提交于 2019-12-10 17:55:41
问题 Lots of examples like order and order lines makes sense, like: Order is an AR that contains OrderLines Customer is an AR that contains Orders . Question is, what is the AR that contains Customer ? I guess it can be something like "shop". So, shop.AddCustomer(customer) ... but, how to get shop? If it's an AR (entity) it has an id, so shop.GetById(shopId) . If I only have one shop, how does this work with persistence? Should I have a table (shops) with one line? Shop is an in-memory object with

How to define DDD Aggregate root for hierarchical data structure?

眉间皱痕 提交于 2019-12-10 10:43:15
问题 I'm currently trying to adapt Domain-driven-design principles to my development practices. And I have stuck on how to define an aggregate root for data that are organized in hierarchies. Let's take for instance folder structure - each folder can have 0..N sub-folders, and sub-folder 0..N can also have 0..N sub-folders and so on. I have invariants on a folder and all it's direct and indirect subfolders - deleting folder should result in deleting all of it's sub-folders Would that be DDD valid

Aggregate roots. How far does the rabbit hole go

家住魔仙堡 提交于 2019-12-08 17:26:16
问题 I'm trying to use the Repository pattern for my current project and i'm currently in the process of trying to model the domain and find the aggregate roots. I've read of the 'Cascading Delete' rule which states that if it doesn't make sense to delete a member when the root is deleted then it shouldn't be part of the root. I'll use a Police incident as an eample :- Incident (Aggregate root) - This could contain investigating officers, notes made by each officer. It could also contain suspects

Aggregate Roots DDD/UoW/Repo/Service

蹲街弑〆低调 提交于 2019-12-08 09:14:34
问题 I have some questions about the Aggregate Objects for Repositories. I'm making a Rest Service with DDD/UoW/Repo and Service pattern. Our new cloud web-apps shall use this service. In order to do this, we also have to sync data from the old databases, which are still in production. We created a "SyncService" which read and writes to/from the cloud and down to earth. In my Rest/DDD-design. And I don't want the business logic to run on these, so in the original test project I have a repository

DDD: Share entity with multiple aggregate roots

孤人 提交于 2019-12-07 11:12:48
问题 Learning DDD, in our application there are three aggregate roots, different types of forms, all of which needs some PDF to be uploaded. These pdf uploads have some metadata, like who uploaded and when uploaded etc, attached to it so they are stored in their own table. My question is whether this PDF should be modeled as a value object or an entity or an aggregate root. For me it looks like an entity named as "Attachment" but then this entity should be shared, only the type not the instances,

Multiple Aggregates Root INSTANCES per transaction

一世执手 提交于 2019-12-07 00:51:51
问题 In DDD the Aggregate should represent the transactional boundary. A transaction that requires the involvement of more than one aggregate is often a sign that either the model should be refined, or the transactional requirements should be reviewed, or both. Does it mean the transaction boundary is per aggregate root INSTANCE or per aggregate? Say I have an aggregate root called "Node", within each "Node" I have a collection of "Fields (Value objects)". Each "Field" is of a Type, and can be of

How to define DDD Aggregate root for hierarchical data structure?

不羁岁月 提交于 2019-12-06 12:14:06
I'm currently trying to adapt Domain-driven-design principles to my development practices. And I have stuck on how to define an aggregate root for data that are organized in hierarchies. Let's take for instance folder structure - each folder can have 0..N sub-folders, and sub-folder 0..N can also have 0..N sub-folders and so on. I have invariants on a folder and all it's direct and indirect subfolders - deleting folder should result in deleting all of it's sub-folders Would that be DDD valid approach to have let's say Aggregate root "Folder hierarchy", that contains 1 "Folder" entity (that

How are consistency violations handled in event sourcing?

喜夏-厌秋 提交于 2019-12-06 06:11:05
问题 First of all, let me state that I am new to Command Query Responsibility Segregation and Event Sourcing (Message-Drive Architecture), but I'm already seeing some significant design benefits. However, there are still a few issues on which I'm unclear. Say I have a Customer class (an aggregate root) that contains a property called postalAddress (an instance of the Address class, which is a value object). I also have an Order class (another aggregate root) that contains (among OrderItem objects

DDD: Share entity with multiple aggregate roots

流过昼夜 提交于 2019-12-05 16:05:55
Learning DDD, in our application there are three aggregate roots, different types of forms, all of which needs some PDF to be uploaded. These pdf uploads have some metadata, like who uploaded and when uploaded etc, attached to it so they are stored in their own table. My question is whether this PDF should be modeled as a value object or an entity or an aggregate root. For me it looks like an entity named as "Attachment" but then this entity should be shared, only the type not the instances, by all the aggregate root. Is it an allowed practice to use same entity type in multiple roots, if so

Multiple Aggregates Root INSTANCES per transaction

最后都变了- 提交于 2019-12-05 04:25:37
In DDD the Aggregate should represent the transactional boundary. A transaction that requires the involvement of more than one aggregate is often a sign that either the model should be refined, or the transactional requirements should be reviewed, or both. Does it mean the transaction boundary is per aggregate root INSTANCE or per aggregate? Say I have an aggregate root called "Node", within each "Node" I have a collection of "Fields (Value objects)". Each "Field" is of a Type, and can be of Type "Node". In my case, if it is of Type "Node", I will store the Id to the "Node" aggregate Root.