Niklas Uhrberg wrote: > So this seems to be the most important question ATM. > I simply assumed that non-root entities can have global identity, but > this may be an error on my part! > It's just so common to let almost everything have a global identity even > if it's not necessary.
Well, "1234567/tire/frontleft" is a global identity in a sense! The path *is* globally unique, even though other tires on a car may have "similar identities, such as "7890/tire/frontleft". Works, right? > In a system for transplantation each body organ would be (probably) be a > root entity, with a global identity despite the "normal intuition" would > be that they are an intrinsic part of me (the root). > > To allow a non-root to "have no owner" (i.e. not be a part of an > aggregate) seems to be a contradiction in terms, but assuming that we > allow it to change owners I think the technical details of > null-assignments and the like is a different matter. Well, if "being a root" is mostly a matter of context, then there is no problem I think. Sometimes an entity is part of an aggregate, and may be a root or not a root, and sometimes it is not part of an aggregate, in which case it is an "aggregate on its own", for all intents and purposes. To me it sounds like most of these things could be supported simply by having an association "Association<Entity> aggregateRoot()" in Entities that are a part of an Aggregate. Sometimes it will be null (=the entity is a root, or is not a part of an Aggregate at all), and sometimes it will have a root set as it is part of an Aggregate. > I suspect that the property of being a root entity signals that it > should /be the root of an aggregate with more than one entity in it. / > But this will often not be the case if only roots have global identity > and reassignment implies global identity. > > My conclusion now is that only root have global identity.... Even if you consider the path-approach, where the identity includes the root identity and the local path? _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

