Hi Dan

 

I have read the “Apache Isis Application Library Developing domain driven
applications using Apache Isis” pdf doc, and I have a question about using
Aggregated annotation.

 

Part IV Reference Appendices B.2. @Aggregated says:

*This annotation indicates that the object is aggregated, or wholly owned,
by a root object.*

*All value types and all collections are automatically aggregated.*

 

1,Does it means we can’t model a collections which element type is another
root aggregate? (I have checked the tck samples, and found all the
collection child entity have no repository, maybe it implies child entity is
not root aggregate?)

For example in a user management application, User,Role are both root
aggregates. There exists a many to many data relationship between User and
Role. 

Is it not necessary to model User with a Collection<Role> property according
to isis @Aggregated annotion’s advice?

2, Is True Invariants the unique reason to use @Aggregated?

Vaughn says in his article:

* When trying to discover the aggregates in a bounded context, we must
understand the model's true invariants.*

Is it true that a user has many roles does not means there exists a “True
Invariants” between them?

 

Best Regards

Alain

 

Reply via email to