Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Practicalities of GMF
Practicalities of GMF [message #219413] Fri, 20 February 2009 10:57 Go to next message
Martin Mising name is currently offline Martin Mising nameFriend
Messages: 32
Registered: July 2009
Member
Hi,

I'm new to GMF and I am trying to understand how to organise things so
that I don't overwrite my work. For instance, what if I want to add an
element or attribute to my model, can I go back and regenerate all my
files without wasting all the work I have done to set them up? Or say I
want to make changes to the graphical model, how can I do this using GMF
without overwriting any changes that I have made to my code?

Of is GMF just something intended to be used once, then all subsequent
changes are made to the code?

The other issue is that I am generating a RCP application. The application
works but I am having trouble dealing with the complexity, as I understand
things Eclipse does this by dividing things into smaller plugins, having
used GMF to create an RCP application can I then switch to just editing
the models as a plugin?

Martin
Re: Practicalities of GMF [message #219446 is a reply to message #219413] Fri, 20 February 2009 11:03 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Martin,

> element or attribute to my model, can I go back and regenerate all my
> files without wasting all the work I have done to set them up? Or say
As much as it possible - yes. :-)

> I want to make changes to the graphical model, how can I do this using
> GMF without overwriting any changes that I have made to my code?
use @generated NOT javadoc comment to protect your class/method from any
modifications on next code generation.

> Of is GMF just something intended to be used once, then all subsequent
> changes are made to the code?
No, it is supposed to be used in step-by-step development.

> then switch to just editing the models as a plugin?
Sure you can edit EMF/GMF - generated plugins manually or write your own
additional plugins. I have to add only one thimg: i suggest you to generate
as much as it possible and use custom code modifications only then it is
necessary. Sure, additional plugins (especially providing some non-GMF functionality)
are absolutely legal and you can write your own..

-----------------
Alex Shatalin
Re: Practicalities of GMF [message #219497 is a reply to message #219413] Fri, 20 February 2009 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

One more remark: If possible, you should use some kind of version
control system, such as CVS or SVN. And if this is not part of your
working infrastructure, you should set up one on your local machine.
Sometimes it just happens that you forget to change a @generated tag to
@generated NOT, which can not only cost you hours of work, but worse:
you will most likely not even notice that the code has been overwritten,
at least not immediately. Synchronizing your projects with a SVN, e.g.
using Subclipse, you can see which files have been changed, and how,
when regenerating the code.

Regards,
Tobias


Martin schrieb:
> Hi,
>
> I'm new to GMF and I am trying to understand how to organise things so
> that I don't overwrite my work. For instance, what if I want to add an
> element or attribute to my model, can I go back and regenerate all my
> files without wasting all the work I have done to set them up? Or say I
> want to make changes to the graphical model, how can I do this using GMF
> without overwriting any changes that I have made to my code?
>
> Of is GMF just something intended to be used once, then all subsequent
> changes are made to the code?
>
> The other issue is that I am generating a RCP application. The
> application works but I am having trouble dealing with the complexity,
> as I understand things Eclipse does this by dividing things into smaller
> plugins, having used GMF to create an RCP application can I then switch
> to just editing the models as a plugin?
>
> Martin
>
Re: Practicalities of GMF [message #219504 is a reply to message #219497] Fri, 20 February 2009 12:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Tobias,

It's good advice because it's scary to work without version control.
The merging generator is nice because it only overwrites files that
actually change, so when you regenerate, you can determine exactly
what's been touched and needs to be checked in.

Martin,

Another good pattern to use, when possible, is to rename a method foo,
to fooGen and then call fooGen for your specialized foo method. This
way fooGen will still be regenerated and your override of it will be
preserved. It's effectively like creating a derived class and putting
your override in there...


Tobias wrote:
> One more remark: If possible, you should use some kind of version
> control system, such as CVS or SVN. And if this is not part of your
> working infrastructure, you should set up one on your local machine.
> Sometimes it just happens that you forget to change a @generated tag
> to @generated NOT, which can not only cost you hours of work, but
> worse: you will most likely not even notice that the code has been
> overwritten, at least not immediately. Synchronizing your projects
> with a SVN, e.g. using Subclipse, you can see which files have been
> changed, and how, when regenerating the code.
>
> Regards,
> Tobias
>
>
> Martin schrieb:
>> Hi,
>>
>> I'm new to GMF and I am trying to understand how to organise things
>> so that I don't overwrite my work. For instance, what if I want to
>> add an element or attribute to my model, can I go back and regenerate
>> all my files without wasting all the work I have done to set them up?
>> Or say I want to make changes to the graphical model, how can I do
>> this using GMF without overwriting any changes that I have made to my
>> code?
>>
>> Of is GMF just something intended to be used once, then all
>> subsequent changes are made to the code?
>>
>> The other issue is that I am generating a RCP application. The
>> application works but I am having trouble dealing with the
>> complexity, as I understand things Eclipse does this by dividing
>> things into smaller plugins, having used GMF to create an RCP
>> application can I then switch to just editing the models as a plugin?
>>
>> Martin
>>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Node Constraint Problem
Next Topic:Arrange All
Goto Forum:
  


Current Time: Fri Apr 26 20:29:30 GMT 2024

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

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

Back to the top