Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (Re)using model elements in other models
(Re)using model elements in other models [message #1479703] Wed, 19 November 2014 17:07 Go to next message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Hi,

i'm thinking about reusing parts of my model in other models.

Let's say I have a class "Entity" where I implemented some basic rules. Now I want to create another new model with a class where I use class "Entity" class as supertype.

When I add entity-ecore to the new ecore by "load resource..." I can archive something like this, but the entity-model-code is generated new in the new project. No custom code is available with this approach - at least not in my usage.

Is there a way use the "Entity" model project (where custom code is included) instead of creating it new?

I appreciate any help.

Cheers,
Philippe
Re: (Re)using model elements in other models [message #1479719 is a reply to message #1479703] Wed, 19 November 2014 17:23 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 19/11/2014 18:07, Phil Wim wrote:
> Hi,
>
> i'm thinking about reusing parts of my model in other models.
> Let's say I have a class "Entity" where I implemented some basic rules.
> Now I want to create another new model with a class where I use class
> "Entity" class as supertype.
> When I add entity-ecore to the new ecore by "load resource..." I can
> archive something like this, but the entity-model-code is generated new
> in the new project. No custom code is available with this approach - at
> least not in my usage.
> Is there a way use the "Entity" model project (where custom code is
> included) instead of creating it new?

When you create the genmodel for your extension .ecore, you can select
the entity model in the lower table denoted "Referenced Generator
Models", like I did quickly here to illustrate:

http://imgur.com/Eg9yWgz
Re: (Re)using model elements in other models [message #1480685 is a reply to message #1479719] Thu, 20 November 2014 11:38 Go to previous message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Felix,

thanks for the quick answer. Exactly what i was looking for.

Philippe


Previous Topic:XSD to dynamic meta model?
Next Topic:Duplicate generated method from extended ecore model
Goto Forum:
  


Current Time: Tue Apr 23 13:20:53 GMT 2024

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

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

Back to the top