EMF Facet - adding additional Attributes [message #1233745] |
Mon, 20 January 2014 06:45  |
Eclipse User |
|
|
|
Hy, I'm just trying to get EMF Facets to know, as I am targetting towards a non-invasive method to extend the Eclipse application model. To this end, i tried
EMF in a small example project and keep having problems.
I already created a bug, that changes to .efacet are not correctly saved.
But the main problem I have is to understand, how I am now able to add additional attributes. I checked out the sample application, and all I see there, is that already existing attributes in the original model are used to create new virtual attributes.
So:
- Is it really possible to introduce new attributes (e.g. of type Estring) to an existing item?
- If yes, is it possible to serialize this attribute with the xmi the original model is persisted with? (On some presentation slides I saw this made the impression)
Thanks,
marco
|
|
|
|
Re: EMF Facet - adding additional Attributes [message #1233819 is a reply to message #1233816] |
Mon, 20 January 2014 10:08  |
Eclipse User |
|
|
|
Hy Hugo,
thank you for your answer. So it is not possible to add "real" and serialized attributes to an existing element, but only to dynamically compute them out of already existing attributes.
Ok, so EMF Facet is of very limited use to me then, as it does not really allow to extend an existing model and its elements by real attribute values. I did look at your presentations with EclipseCon and from the presentations it seemed to me that this is possible.
I was hoping for something like this - I have an element of a third-party model
<children xsi:type="advanced:Placeholder" xmi:id="_51y38FEAEeOs7KUvDVp0Mg" elementId="at.medevit.ecrit.pharmacy_at.application.placeholder.2" ref="_0mzDgFEAEeOs7KUvDVp0Mg"/>
and using EMF Facets i would be able to create a serialized version of this like
<children xsi:type="advanced:Placeholder" xmi:id="_51y38FEAEeOs7KUvDVp0Mg" elementId="at.medevit.ecrit.pharmacy_at.application.placeholder.2" ref="_0mzDgFEAEeOs7KUvDVp0Mg" eFacet:documentation="This is a facet added string"/>
which would blend into resource storage, without requiring a modification of the original model and not breaking it.
|
|
|
Powered by
FUDForum. Page generated in 0.05724 seconds