Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to handle domain update in GMF?
How to handle domain update in GMF? [message #767734] Sun, 18 December 2011 20:04 Go to next message
Arieh Bibliowicz is currently offline Arieh BibliowiczFriend
Messages: 18
Registered: June 2011
Junior Member
Is there a "correct" way to handle domain changes in GMF? Since there is a lot of generated code, how is this handled? must I delete the old code and generate again? does the generator override the existing code?
I did some tests with a simple diagram, changing the model and generating the diagram again, but nothing happened.
Thank

Arieh
Re: How to handle domain update in GMF? [message #767913 is a reply to message #767734] Mon, 19 December 2011 07:47 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

if your EMF model changes you need to generate new EMF code, fix the gmf models and generate new code from that. All methods that have a @generated tag will be overwritten. If you change to @generated not the method will not be overwritten. However, it is not recommended to mix generated and hand written code with each other. So you should use customized code generation templates, extension points etc. for your modifications. If you do not have mixed hand written and generated code you can delete the generated code/plugins and regenerate them again. Here, you must find out how much to delete is best for you. Again you need to take a bit of care because files like plugin.properties can happen to not reflect changes in your models. Additionally I do automatise the changes made to generetor models (e.g. .genmodel or .gmfgen). This can be usefull in some cases where your generator model does not get updated in the right way. For this case you could use gmf's option to execute a QVTo transformation after code generation or start e.g. an ATL transformation by hand.

Ralph
Re: How to handle domain update in GMF? [message #767925 is a reply to message #767913] Mon, 19 December 2011 08:07 Go to previous messageGo to next message
Arieh Bibliowicz is currently offline Arieh BibliowiczFriend
Messages: 18
Registered: June 2011
Junior Member
Thanks Ralph. I have some experience with EMF, so I was aware of the @generated tags, but does GMF work in the same way?
And, is this really feasible? I mean, you can loose a lot of time searching for code that you must fix/delete/update, and if something breaks it takes more time to fix it...
Re: How to handle domain update in GMF? [message #767959 is a reply to message #767734] Mon, 19 December 2011 09:33 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I recommend to not use @generated NOT, as you said it is hard to maintain.
You can take a look to the 5th slides of my presentation at #ese http://www.slideshare.net/BonitaSoft/eclipse-summit-europe-modeling-symposium

It indicates the best way to update your domain model (from my POV at least).

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Previous Topic:[GMF] Set Attributes dependant to another Attribute
Next Topic:Place default elements inside comparment
Goto Forum:
  


Current Time: Thu Mar 28 21:00:12 GMT 2024

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

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

Back to the top