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?
source
share