Gang, We also spent a great deal of time to define what Aggregates are, and how to fulfill the Evan's rules of Aggregates (p.128 in my copy).
We think that the whole story can be captured by a @Aggregated annotation on Association and ManyAssociation. The @Aggregated annotation will be used when building the internal models to give the entity boundaries and a single Entity Root, as described by Evans. Here are the basic rules/stuff we need to implement; * An entity can only be assigned to a single @Aggregate association. A second assignment will fail. * When an assignment is made to an association, the Qi4j Runtime will ensure that the Entity assigned (unless it is its own root) share the root entity with the Entity being assigned. * When an entity is removed, all the @Aggregate associations must also be removed. * Furthermore, indexing needs to be changed so that only entity roots can be the result type, although sub entities can be used to create where-clauses. * Finally, when a change occurs to a sub-entity, the root entity must be notified and do invariants validation of UnitOfWork.complete(). There might be some additional details that I have missed. QI-150 will be complemented with the findings so far. WDYT?? Cheers Niclas _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

