On 2009-11-13 16.51, Jacek Sokulski wrote:
1. Does it mean there is no (much value in) inheritance in COP?
Correct, you accomplish much of the same thing using mixins.
2. Does it mean e.g properties one usually expect to find both in Manager and Employee like name, department are modelled as separate roles e.g. HasName, InDepartment (then the query findByName can be implemented for all entities with HasName role)?
Correct.
3. Is there a mechanism to restrict/define what *actual* roles an entity can play? Or is it the context responsibility to check if a Person can play the Manger role and this info should be part of entity/role state?
The easiest way to do it is to separate between Managerable and Manager role, so that a Manager role can only be assigned to an entity that is Managerable. You will VERY rarely (if ever) refer to the actual entity classes, in preferences of using the role interfaces. This makes it easier to read the code and manage dependencies, and also makes it easier to apply roles to various entities.
/Rickard _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

