eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
1 stars 0 forks source link

[pivot] Regularize extension properties #2222

Open eclipse-ocl-bot opened 2 months ago

eclipse-ocl-bot commented 2 months ago

| --- | --- | | Bugzilla Link | 578010 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 01, 2022 04:44 EDT | | Modified | Jun 10, 2022 16:54 EDT | | Blocks | 509309 | | See also | 577902, 580136 | | Reporter | Ed Willink |

Description

The rationalization of ststic properties and the addition of an incompatible property validation highlights a pragmatism in the stereotype reification that is inconsistent with the normalized pivot philosophy.

AT M2, UML defines an Extension association to bind e.g. base_Class to extension_MyStereotype. There is therefore a regular M2 navigation via Stereotype::base_Class from the Stereotype named MyStereotype to the Class named Class and via Class::extension_MyStereotype from the Class named Class to the Stereotype named MyStereotype.

This is reified at M1, so that there is also a navigation via MyStereotype::base_Class from any MyStereotype to an appropriate Class and via Class::extension_MyStereotype from any Class to an appropriate MyStereotype. (MyStereotype is the StereotypeExtender named MyStereotype)

The current implementation re-uses the M2 definitions as the reifications, which avoids creating (not that many) copies, but the re-use violates invariants such as the source of Stereotype::base_Class re-used as MyStereotype::base_Class being a MyStereotype. The re-use of the M2 Class::extension_MyStereotype at M1 is clearly wrong once the opposite is considered. The re-use marks the Property as static to 'help' the pragmatism work at the wrong meta-level.

The M2 definitions must be reified as regular properties at M1, and the M2 Class must bedistinct from the M1 Class to distinguish extension_MyStereotype.

Once stereotypes are fully normalized during UML loading by UML2AS, the need for UML specifics such as Class::etenders may be redundant. The unpleasant need for an extended IdResolver for UML might go away allowing UML to be properly optional.

?? The M2 versions of the Properties really are static, since the target of \ Class::extension_MyStereotype is the one and only Stereotype named MyStereotype for all declared Class and derived Class. Similarly the target of MyStereotype::base_Class is the one and only Class named Class.

eclipse-ocl-bot commented 2 months ago

By Ed Willink on Jan 01, 2022 05:37

(In reply to Ed Willink from comment #0)

the M2 Class must bedistinct from the M1 Class

At M2 we are in the UML model space for UML model declarations.

At M1 we are in the normalized Pivot space.

These can perhaps be distinct so there might be no problem if we stop folding UML into PIvot.