[gme-users] Polymorphism in OCL
Zawar Qayyum
zawarq at gmail.com
Thu Mar 9 17:41:12 CST 2006
Hello Guys
I can't seem find any reference to polymorphism in the OCL reference,
although its present in UML. In GME for example the following doesn't
produce the desired results:
self->parts(ValueType)->forAll(q1, q2 : ValueType | q1 <> q2 implies
q1.Index <> q2.Index)
In the above scenario, various Models inherit from ValueType. The variable
Index is defined in ValueType, and containment of ValueType is defined
for the current object (self) class. But all the objects contained in self
are child types of ValueType, and not of ValueType itself. But the condition
q1, q2: ValueType doesn't seem to include the child types and therefore the
constraint is not applied.
The question is: is this an OCL shortcoming or is it something thats missing
in the implementation?
Regards
Zawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20060309/4f3585f9/attachment.htm
More information about the gme-users
mailing list