Maintaining Compatibility Between New and Old Ecore Models [message #167526] |
Wed, 09 January 2008 23:24 |
Eclipse User |
|
|
|
Originally posted by: jdente.21technologies.com
Hi,
I have a GMF project that has been used for a while now to build some rather
large diagrams. Recently, in order to accomodate an improvement, I added a
new class to my ecore model. I wrote some extra code to handle old diagrams
so that if a diagram does not contain the newly added class, rather than
throwing a null pointer, I create the new class. Unfortunately this is not
the only problem. When the new class was created, the VISUAL_IDs changed
for several elements from my old diagrams. In order to make the new version
of my GMF project compatible with old diagrams, I had to manually revert all
the VISUAL_IDs back to their original values and then make my new class have
a different VISUAL_ID that I assigned. While this solution works, it is not
very practical. This means that anytime we need to tweak our ecore model, I
will have to manually fix all of the IDs in the generated code in order to
maintain reverse-compatibility.
Is there any way to control the VISUAL_IDs and TYPE_IDs assigned? Is there a
better way to maintain compatibility between different versions of ecore
models?
Thanks,
Joe
|
|
|
Re: Maintaining Compatibility Between New and Old Ecore Models [message #167571 is a reply to message #167526] |
Thu, 10 January 2008 16:06 |
Eclipse User |
|
|
|
Originally posted by: jdente.21technologies.com
I found the VISUAL_IDs buried in my gmfgen file. I'm guessing that manually
setting the VISUAL_IDs in my gmfgen so that they are compatible with my
earlier diagrams and then generating the code is the easiest method for
maintaining reverse compatibility.
If anyone has a better method or other suggestions on maintaining backwards
compatible diagrams, please let me know.
Thanks,
Joe
"Joe Dente" <jdente@21technologies.com> wrote in message
news:fm3l4d$dj$1@build.eclipse.org...
> Hi,
>
> I have a GMF project that has been used for a while now to build some
> rather large diagrams. Recently, in order to accomodate an improvement, I
> added a new class to my ecore model. I wrote some extra code to handle
> old diagrams so that if a diagram does not contain the newly added class,
> rather than throwing a null pointer, I create the new class.
> Unfortunately this is not the only problem. When the new class was
> created, the VISUAL_IDs changed for several elements from my old diagrams.
> In order to make the new version of my GMF project compatible with old
> diagrams, I had to manually revert all the VISUAL_IDs back to their
> original values and then make my new class have a different VISUAL_ID that
> I assigned. While this solution works, it is not very practical. This
> means that anytime we need to tweak our ecore model, I will have to
> manually fix all of the IDs in the generated code in order to maintain
> reverse-compatibility.
>
> Is there any way to control the VISUAL_IDs and TYPE_IDs assigned? Is there
> a better way to maintain compatibility between different versions of ecore
> models?
>
> Thanks,
> Joe
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03520 seconds