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

Add EAnnotationValidator support #87

Open eclipse-uml2-bot opened 1 week ago

eclipse-uml2-bot commented 1 week ago

| --- | --- | | Bugzilla Link | 528376 | | Status | NEW | | Importance | P3 enhancement | | Reported | Dec 10, 2017 05:50 EDT | | Modified | Dec 11, 2017 09:18 EDT | | Reporter | Ed Willink |

Description

EMF 2.14M3/M4 adds EAnnotation validators. See Bug 418619.

This provides an opportunity for erroneous UML EAnnotations such as "subsets" etc to be validated, and for the editor to offer creation/maintenance support.

It also provides an opportunity for a model to define a metaclass for each EAnnotation source thereby documenting some previous magic.

However, how many users edit the UML EAnnotations? It will not help Papyrus users. The main value will be in documenting the UML EAnnotation sources and verifying that their auto-generated usage complies with the documented expectation.

When implementing the validators there are two styles that you can follow.

a) EMF's EcoreAnnotation.ecore and BasicEAnnotationValidator that requires the metaclasses to be manually constructed. A distinct *Annotation.ecore is required for each source.

b) OCL's PivotAnnotations.ecore and a derived BasicEAnnotationValidator2 that uses genmodel to construct all the metaclasses and supports many annotation sources in a single Annotation metamodel.

(With EMF now supporting validation of OCL embedded in delegate EAnnotations, perhaps the WONTFIX on Bug 427152 body support should be revisited.)

eclipse-uml2-bot commented 1 week ago

By Kenn Hussey on Dec 11, 2017 09:18

Most of the annotations generated/used by UML2 (including ones like "subsets", "redefines", etc.) are "internal" and aren't meant to be edited directly by the user. I don't have a good sense for how common it is for users to edit annotations on UML models beyond that...