Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Ecore model replacement(I want to replace my GMF Editor's Ecore model with another one)
Ecore model replacement [message #882330] Wed, 06 June 2012 09:05 Go to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
we have an Eclipse GMF Editor which is based on an Ecore model that was hand-coded from a specification document.

Now, we have written a tool which automatically transforms the specification into an Ecore model.

My task now is to replace the hand-coded Ecore model with the generated one. At this, the GMF Editor should work with the new Ecore. The generated Ecore and the hand-coded Ecore differ in some ways (different names of attributes, classes, a few more classes).

My question now is:

How should I, or how easy is it to get the GMF Editor working. I am sure I could reuse the Tooling Model and the Graphical Model. My idea was to simply adapt the mapping model. However, when I replace the Ecore model, all the @generated NOT stuff will be lost.

How would you do the Ecore exchange ?!
Re: Ecore model replacement [message #882333 is a reply to message #882330] Wed, 06 June 2012 09:11 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

that's why modified @Generated Not is a bad practice (from my POV)
See the 5th slide of my talk: http://www.slideshare.net/BonitaSoft/eclipse-summit-europe-modeling-symposium

Unfortunately, I'm not sure to understand your use case to answer with more details :s

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Ecore model replacement [message #882336 is a reply to message #882330] Wed, 06 June 2012 09:14 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
what we want to do is the following:
If the specification changes, we can automatically generate an Ecore.

This generated Ecore should be used to automatically generate the editor.

At the moment, the Editor is based on a hand-coded Ecore model which differs from the generated one. My task now is to replace the hand-coded with the generated Ecore.

does this help ?!
Re: Ecore model replacement [message #882343 is a reply to message #882336] Wed, 06 June 2012 09:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Matthias,

If you use Java refactoring to rename the artifacts generated from your
model such that you refactor them to the new names used in the new
version of your model, you should then be able to generate the code for
the new model over top of those refactored artifacts to preserve your
hand-written changes.


On 06/06/2012 11:14 AM, Matthias N wrote:
> what we want to do is the following:
> If the specification changes, we can automatically generate an Ecore.
>
> This generated Ecore should be used to automatically generate the editor.
>
> At the moment, the Editor is based on a hand-coded Ecore model which
> differs from the generated one. My task now is to replace the
> hand-coded with the generated Ecore.
>
> does this help ?!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Ecore model replacement [message #882345 is a reply to message #882343] Wed, 06 June 2012 09:33 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Hi Ed, good suggestion, thanks!

But otherwise my approach should work: Simply adapt the mapping model ?!
Re: Ecore model replacement [message #882349 is a reply to message #882345] Wed, 06 June 2012 09:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Matthias,

Yes, I think so.


On 06/06/2012 11:33 AM, Matthias N wrote:
> Hi Ed, good suggestion, thanks!
>
> But otherwise my approach should work: Simply adapt the mapping model ?!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Ecore model replacement [message #882439 is a reply to message #882333] Wed, 06 June 2012 13:12 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Aurelien Pupier wrote on Wed, 06 June 2012 05:11
Hi,

that's why modified @Generated Not is a bad practice (from my POV)
See the 5th slide of my talk: url...
Unfortunately, I'm not sure to understand your use case to answer with more details :s

Regards,


How would you use the "@generated NOT"? Sorry but here at work they don't allow slideshare (so stupid).
Re: Ecore model replacement [message #882478 is a reply to message #882439] Wed, 06 June 2012 14:29 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Matthias N wrote on Wed, 06 June 2012 15:12
Aurelien Pupier wrote on Wed, 06 June 2012 05:11
Hi,

that's why modified @Generated Not is a bad practice (from my POV)
See the 5th slide of my talk: url...
Unfortunately, I'm not sure to understand your use case to answer with more details :s

Regards,


How would you use the "@generated NOT"? Sorry but here at work they don't allow slideshare (so stupid).


I'm using the generated code only as a sandbox, to test quickly new features. Code is regenerated at each build.
You can use GMF-Tooling model, extension points and generation templates to make your customizations.

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Ecore model replacement [message #884742 is a reply to message #882478] Mon, 11 June 2012 18:07 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Aurelien Pupier wrote on Wed, 06 June 2012 10:29
Matthias N wrote on Wed, 06 June 2012 15:12
Aurelien Pupier wrote on Wed, 06 June 2012 05:11
Hi,

that's why modified @Generated Not is a bad practice (from my POV)
See the 5th slide of my talk: url...
Unfortunately, I'm not sure to understand your use case to answer with more details :s

Regards,


How would you use the "@generated NOT"? Sorry but here at work they don't allow slideshare (so stupid).


I'm using the generated code only as a sandbox, to test quickly new features. Code is regenerated at each build.
You can use GMF-Tooling model, extension points and generation templates to make your customizations.

Regards,


Hi Aurelien, can you provide me more information about how and which "generation templates" you use ?

thank you very much
Re: Ecore model replacement [message #884975 is a reply to message #884742] Tue, 12 June 2012 07:52 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

he is talking about that: http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-editor-by-customizing-templates/

Ralph
Previous Topic:Download of ziped p2 repositories?
Next Topic:trace files
Goto Forum:
  


Current Time: Tue Apr 23 06:30:25 GMT 2024

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

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

Back to the top