OCL Inheritance [message #1470904] |
Wed, 12 November 2014 18:26 |
Rishi Kanth Messages: 18 Registered: October 2014 |
Junior Member |
|
|
Hi,
I have created a UML Profile with the following structure :- two stereotypes A1 and A2, where A1 is extension of UML::Assocication and A2 is derived from A1(or A1 is a generalization of A2).
I have defined two OCL constraints OC1 (applied to A1) as
self.base_Association.endType.getAppliedStereotypes()->asBag().name = Bag{'ST1','ST1'}
or
self.base_Association.endType.getAppliedStereotypes()->asBag().name = Bag{'ST1','ST3'}
and OC2 (applied to A2) as
self.base_Association.endType.getAppliedStereotypes()->asBag().name = Bag{'ST2','ST3'}
(ST1, ST2 and St3 are stereotypes from another profile that extend UML:Class)
As A2 is derived from A1, how do the OCL constraints behave. From my experimenting and observation, A2 inherits the OCL from A1 and combines them as OC2 AND OC1.
Please correct me if I am wrong and also, if any other information on this topic.
Thanks,
Rishi
|
|
|
Powered by
FUDForum. Page generated in 0.03894 seconds