Rickard Öberg wrote:
> Niklas Uhrberg wrote:
>
>> Here there is really no need to have the AssociationRole hold the name
>> "mother" or "father".
>> This is indeed a very common way of modelling, but I also acknowledge
>> that there is a benefit in the case of many multiple associations which
>> should be named.
>>
>
> I've been reading more articles on the topic, and I now agree with your
> earlier suggestion that it should be "Qualifier", so the previous
> example would become:
> interface Product
> extends EntityComposite
> {
> ManyAssociation<Qualifier<Company,Vendor>> suppliers();
> }
>
> Where Company is a general entity and Vendor is the qualifier of the
> Company in this particular suppliers association.
>
> This seems to match the terminology descriptions I have found so far,
> and how you have described it. Makes sense?
>
Yes, fine.
I think the difference between the "single valued" association
("mother", "father") and many valued association is a bit disturbing.
This is has nothing to du with Qi4J as such, it's just that
the most straightforward way of naming the role is using the name of
the property itself, and this is not possible in the may valued case.
> As for why this is better than just doing:
> interface Product
> extends EntityComposite
> {
> ManyAssociation<Vendor> suppliers;
> }
> and then:
> interface Vendor
> extends EntityComposite
> {
> Property<Long> performance();
> Association<Company> company();
> }
>
> is that in the latter case Vendor is hardcoded to Company, and if
> Qualifier is used the Vendor Qualifier can be used with other kinds of
> Entities. For Blocket.se it might be used with Person entities, for
> example, rather than Companies.
>
There is more too, making the qualification role in the model explicit
is very valuable to me. (Has already been said earlier...)
> /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