Re: Parent/Children AggregateRoot problem
Carlos Peix <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAM5-WxGM6d21Wiqa9nEepwvP=ToLjjdTBx2L7NF+tiQksV2EoQ@mail.gmail.com> |
Hi, I know it's a very late reply but... Aggregates are *instance* structures, not a class ones. So yes, it's perfectly OK to nest instances. In this particular case, each Category instance is a root and a potential leaf in the aggregate so it's OK, IMO, for other objects to hold references to it. ---------------------------------- Carlos Peix On Fri, Nov 13, 2009 at 8:14 PM, zhihaiqi <[email protected]> wrote: > > > hi, i have a question frustrating me a lot: > > eg: > class Category { > Category parent; > Set<Category> children; > } > > an entity "Category", it has parent/children relationships, > can it be the AR that aggregates its children with same class? > if so, can the other entities direct reference to it(and its children) > > need for help > Thanks and sorry for my poor english > > >