OCL delegate evaluation [message #1049902] |
Fri, 26 April 2013 12:33 |
ModelGeek Mising name Messages: 550 Registered: June 2011 |
Senior Member |
|
|
I have a very simple Ecore model contains 3 classes(Class1, Class2, Class3).
Connection between classes are as follows
Class1->Class2
Class2->Class3
Class1->Class3 (derived)
Class3 has boolean attribute with derivation statement
Class1.allInstances().class3->includes(self); // check myself is included in Class1.class3 property.
consider i instantiate this ecore with one instance of Class1 connected 5 instances of Class2 and each instance of Class2 is connected with 5 different instances of Class3.
My question is related to evaluation approach. Will Class1->class3 relation will be evaluated for every instance of class3 or Class1->class3 will be evaluated once?
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';
package temp : TEST = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
class Class1
{
property class2#class1 : Class2[*];
property class3#class1 : Class3[*] { derived volatile }
{
derivation: class2.class3->asSet();
}
}
class Class2
{
property class1#class2 : Class1[*] { ordered };
property class3#class2 : Class3[*];
}
class Class3
{
attribute available : ecore::EBooleanObject { derived volatile }
{
derivation: Class1.allInstances().class3->includes(self);
}
property class1#class3 : Class1[*] { ordered derived volatile }
{
derivation: ;
}
property class2#class3 : Class2[*] { ordered };
}
}
Regards,
[Updated on: Fri, 26 April 2013 12:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03551 seconds