Hi, I discussed this briefly with Rickard last week before it entered 
the mailing list.

It started with the possibility of implementing the association class in 
UML which has no counterpart in "plain java".

So, it's just a matter of putting data on an association between 
entities, an example is startDate on things like employment (just an 
example, maybe not a good one).

I'm a but concerned about the term "role" in the discussion because 
roles are used for something else in modelling.
Drawing on the example with the spouse relation, a person has an 
associated person which is his or her spouse , the other person entity 
plays the role of being the spouse.
 
Possibly one would like to put start- and end dates on this association 
and this would motivate an association class between them as opposed to 
just a regular association.

I write this just to see to that we mean the same things with "role" and 
"association class" and to motivate that "AssociationRole" is IMHO a bit 
misleading.
Note that the data we put on an association *can* be another entity in 
the strict meaning that it's not just a way of implementing it in Qi4J.

Example: A person har the spouse association to another person. This 
association is qualified be the "introduced by" association which is yet 
another Person entity.

/Niklas Uhrberg

Rickard Öberg wrote:
> Niclas Hedhman wrote:
>   
>> Uhhh.... To clear this;
>>
>> Association<Person> spouse();
>> vs
>>
>> Association<AssociationRole<Person, Marriage>> spouse();
>>     
>
> This is the one. The Association is set to a "package deal". If 
> AssociationRole is a subtype of Association it would otherwise be 
> potentially possible to set role but not association, which would be 
> confusing. It also doesn't work well for manyassociations to do it the 
> other way.
>
>   
>> Ok, so for the Employer example, the Position is a aggregate of the
>> Association between the Employer and Employee, and if the Position is
>> an actual company entity, with salary, rights, responsibilities and so
>> on, that must be one indirection further away?? Incredibly important
>> to understand.
>>     
>
> Not 100% sure what you mean with "is a aggregate of the Association 
> between the Employer and Employee". Also "Position" cannot be a "company 
> entity" (it's just a Position, which is immaterial), if you are saying 
> "Position can be a Company". Too confusing terminology right now to make 
> sense.
>
> /Rickard
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>
>   


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to