eclipse-uml2 / uml2

An EMF-based implementation of the UML 2.x metamodel for the Eclipse platform.
Eclipse Public License 2.0
5 stars 4 forks source link

Support static Features in UML2Ecore #112

Open eclipse-uml2-bot opened 1 week ago

eclipse-uml2-bot commented 1 week ago

| --- | --- | | Bugzilla Link | 577573 | | Status | NEW | | Importance | P3 normal | | Reported | Dec 01, 2021 15:26 EDT | | Modified | Dec 01, 2021 15:29 EDT | | See also | 415146 | | Reporter | Ed Willink |

Description

UML supports static features.\ Java supports static features.\ Ecore does not support static features.\ OMG OCL supports static features but with undefined semantics.

Consideration of a maths library for OCL motivates making statics work after using the OCL2Java extension to EMF GenModel.

How can OCL statics generate Java when EMF cannot?

Ah! UML2Ecore should demonstrate the way.

Oops! UML2Ecore just discards the isStatic attribute.

Surely, as a minimum, UML2Ecore should diagnose a static feature as a conversion failure?

More usefully, UML2Ecore should propagate the isStatic as an EAnnotation.

So that even more usefully this EAnnotation could drive generatiion of static Java features corresponding to the static UML features.

Suggest the EAnnotation:

  <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML">\
    <details key="static" value="true"/>\
  </eAnnotations>

Pending UML2 project support, Eclipse OCL can support this annotation as the Ecore persistence of OCLinEcore, and the OCL2Java can hide the static features to suppress erroneous Ecore treatment and provide a reification in XXXTables.java.