EMF extension mechanisms [message #871594] |
Mon, 14 May 2012 09:42  |
Eclipse User |
|
|
|
Hello,
I was wondering if there is a way to extend a meta model. Suppose that I have a meta model in EMF which is used in my application. Now, I would like to leave that meta model open to extensions: similar as what you have in Eclipse with the extension points. So, a separate bundle could extend an EClass in my meta model for instance. Of course, I don't want to generate my full model code once again in the separate plug-in but that my application can "manipulate" those new objects (through a known base class of course).
Is there a way to do something like that ?
If not, what would be a good strategy for such a scenario ? The serialization sould of course take that into account (so, the extensions should also be persisted in the same file).
Thanks
|
|
|
|
|
Re: EMF extension mechanisms [message #871613 is a reply to message #871605] |
Mon, 14 May 2012 10:21  |
Eclipse User |
|
|
|
Cedric,
Yes, that's what the tutorial shows, i.e., how someone can extend your
base model. Instance can then be contained or referenced anywhere that
a base instance is allowed and it will be serialized properly
On 14/05/2012 4:10 PM, Cedric Moonen wrote:
> Hi Ed,
>
> Thanks for the fast reply. I already saw those articles but I don't
> think they answer my question (or maybe I misunderstood them).
>
> Let me try to explain my problem differently: I designed a meta model
> which is the "core" of my application (I used EMF for obvious reasons:
> notifications, serialization support, ...). My application code (which
> is manually written code) is then manipulating the generated model. I
> only generated the model code, the edit and editor were not needed for
> my case.
> Now, suppose that in my meta model I have an abstract EClass called
> Item (with some properties) and some concrete items which inherit from
> Item: my application is able to manipulate items. I would like
> additional plug-ins to be able to contribute their own item EClasses,
> without having to touch my core application. The way that these items
> can be created is specific to my application. The important part here
> is that I can now construct a model instance in which some of the
> items are items contributed by the additional plug-in. When I persist
> my model, those "custom" items should also be persisted (as if they
> were in my original meta model).
>
> Does that make sense ?
|
|
|
Powered by
FUDForum. Page generated in 0.10134 seconds