Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extending a metamodel without overriding it
Extending a metamodel without overriding it [message #1830579] Wed, 29 July 2020 11:29 Go to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Hi,

I wish to extend an existing metamodel, without changing it or breaking any existing implementations.

I created a new ECORE Modeling project (model B) and add the original metamodel (model A) as a project dependency. Then, I created a new class (class B), and specified one of the classes (class A) in the original metamodel as its supertype.
When I generate code and try to test it (using a run configuration), I see two new models are available: one is a duplication of the original model (model A, now appearing twice), and one is the new model B.
When I create a new model A instance, I am able to create element of type class B (which is good). However, it seems like all model A implementation was duplicated, as I no longer see the original model A icons in the model explorer, and when I use Sirius.
The model is also depicted as ModelA.impl.RootelementImpl@524feab2 (name: null) in the model explorer, and I am unable to view its element unless I open it with Model editor.

Any suggestions how to fix this? Is there a way to extend a metamodel without any replication?

Any suggestions will be much appreciated.

Regards,
Avi
Re: Extending a metamodel without overriding it [message #1830586 is a reply to message #1830579] Wed, 29 July 2020 12:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I think your question is just like this recent one:

https://www.eclipse.org/forums/index.php/mv/msg/1104694/1830579/#msg_1830579

You should make sure that the *.genmodel for B reuses the GenPackage for A from A's *.genmodel as shown the link above. You'll need to do some cleanup in the MANIFEST.MF and the plugin.xml (or delete them and generate them fresh).


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extending a metamodel without overriding it [message #1830623 is a reply to message #1830586] Thu, 30 July 2020 04:28 Go to previous message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Great!
Problem solved. Many thanks!
Previous Topic:Save Resource Without Alphabetic Sorting
Next Topic:[CDO] Cleanup of non-referenced blobs
Goto Forum:
  


Current Time: Tue Apr 23 10:33:07 GMT 2024

Powered by FUDForum. Page generated in 0.02834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top