Community
Participate
Working Groups
Annotations are generic properties of the model elements that greatly extend model usability. One may add documentation, validation constraints and other data that was not considered during model design or ignored due to infrequent use. - use ecore model EAnnotation class for annotations - add ModelObject class with eAnnotations reference - all other objects should extend ModelObject class
Reusing ecore.EAnnotation and not subclassing EModelELement has a drawback of containment's opposite EAnnotation#getEModelElement that is always null.
And why it's a drawback? What will break?
1. To navigate back to owner, one would need to use eContainer and a cast 2. EAnnotation is "known" api, and with that, clients tend to expect getModelElement to return meaningful value (if you got used to EAnnotations where modelElement is always set, it might be not that obvious to switch to same EAnnotations but with modelElement == null).
1. There is no much difference between EObject and EModelElement so there will be a cast anyway. 2. Use eContainer().
[GMF Restructure] Bug 319140 : product GMF and component Models - Mapping was the original product and component for this bug