Domain Managed Project: Aggregate Roots and Sub-Aggregate Roots

In my project, I find it necessary to split my aggregate hierarchically, with an aggregate of the top level of the root, which ensures consistency of rules at the root level, and then my objects under the root can be grouped into various aggregates. When calculating the integrity of the root level aggregate, the root checks its own rules and then delegates to subaggregate the roots to determine if the aggregate is valid.

Also, in order to implement optimistic locking, I find that if I apply locks at different sub-aggregate levels, I can allow my system to be highly competitive, rather than putting the lock at the aggregate root level.

Is this a valid ddd approach?

+3
source share
1 answer

I don’t know enough to “know”, but that sounds good to me - other than who is “responsible” for identifying such things? This industry is so full of subjectivity when it comes to words and applying them to a given implementation.

For me, the most important basic principle of DDD is whether you really adhere to the application from the point of view of business people and as close as possible adhere to the ubiquitous language. I cannot say this from your description, but you should be able to make this judgment well enough.

"", , DDD, , , , , , .

, , , . , , , , .:)

+3

Source: https://habr.com/ru/post/1718407/


All Articles