Which entities should be Aggregate Roots?
Posted
by MylesRip
on Stack Overflow
See other posts from Stack Overflow
or by MylesRip
Published on 2010-03-17T23:22:51Z
Indexed on
2010/03/17
23:31 UTC
Read the original article
Hit count: 196
domain-driven-design
If Book aggregates Chapter which in turn aggregates Page, then what should be the aggregate root? One possibility might be:
Book is an aggregate root with Chapter as a leaf and Chapter is an aggregate with Page as a leaf.
In this scenario, Chapter is a leaf in one aggregate and a root in another. Is this okay? Would it make sense in this scenario to have two repositories, one for Book and another for Chapter? If so, then couldn't the Chapter repository be used to circumvent the fact that access to Chapter should only happen via Book? What would be the best way to handle a situation like this?
© Stack Overflow or respective owner