Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Meta-model (ecore) versioning support
Meta-model (ecore) versioning support [message #536690] Sat, 29 May 2010 22:04 Go to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Hi,

I'm wondering if anyone has given any more recent thought to how to support evolving metamodels in .ecore representations. I'm not worried about fancy automated M2M mapping support ala http://stackoverflow.com/questions/492678/meta-model-evoluti on-in-the-eclipse-modeling-framework, instead my (relatively) simple requirement is:

Use the same extension (i.e. ecore model name) for newer versions of my models. The older models may or may not validate to the new schema, so I'd want to be able to detect an older version at the point where the user opens the model and then automatically (with user consent, naturally) up-convert the model by loading the model with the old ..model and then mapping it over to the new one.

Of course, the approach where you simply change the extension name is pretty trivial. But I can think of a million things that could get hairy with using the same extension...so I wanted to see if there are any efforts toward OOTB (or close) support for this.

cheers,

Miles
Re: Meta-model (ecore) versioning support [message #536725 is a reply to message #536690] Sun, 30 May 2010 11:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Miles,

Comments below.

Miles Parker wrote:
> Hi,
>
> I'm wondering if anyone has given any more recent thought to how to
> support evolving metamodels in .ecore representations. I'm not worried
> about fancy automated M2M mapping support ala
> http://stackoverflow.com/questions/492678/meta-model-evoluti on-in-the-eclipse-modeling-framework,
> instead my (relatively) simple requirement is:
>
> Use the same extension (i.e. ecore model name) for newer versions of
> my models. The older models may or may not validate to the new schema,
> so I'd want to be able to detect an older version at the point where
> the user opens the model and then automatically (with user consent,
> naturally) up-convert the model by loading the model with the old
> ..model and then mapping it over to the new one.
There's the data migration recipe in the wiki.
http://wiki.eclipse.org/EMF/Recipes
>
> Of course, the approach where you simply change the extension name is
> pretty trivial. But I can think of a million things that could get
> hairy with using the same extension...so I wanted to see if there are
> any efforts toward OOTB (or close) support for this.
Note that that EMF supports content types like the platform, so if you
change the namespace you can easily recognize different content types
from the same extension by virtue of the namespace on the root element.
>
> cheers,
>
> Miles


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Meta-model (ecore) versioning support [message #536750 is a reply to message #536725] Sun, 30 May 2010 17:15 Go to previous message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Ed Merks wrote on Sun, 30 May 2010 07:27

> Use the same extension (i.e. ecore model name) for newer versions of
> my models. The older models may or may not validate to the new schema,
> so I'd want to be able to detect an older version at the point where
> the user opens the model and then automatically (with user consent,
> naturally) up-convert the model by loading the model with the old
> ..model and then mapping it over to the new one.

There's the data migration recipe in the wiki.
http://wiki.eclipse.org/EMF/Recipes


[quote]> Of course, the approach where you simply change the extension name is
> pretty trivial. But I can think of a million things that could get
> hairy with using the same extension...so I wanted to see if there are
> any efforts toward OOTB (or close) support for this.
Note that that EMF supports content types like the platform, so if you
change the namespace you can easily recognize different content types
from the same extension by virtue of the namespace on the root element./[quote]

Yeah, wow. That's one of those things that makes so much sense in retrospect that I don't know why it didn't occur to me. I could just keep all of the legacy stuff in the evolved meta-model and map it to the new corresponding meta-classes. (It's quite likely that the old meta-model wouldn't parse with the changes that I intend.) That will leave some overhead around and probably entail moving everything into new packages, but over-time I could deprecate any dross away.
Previous Topic:Checks for Generic EMF Form Editor using Xtend in combination with Java method
Next Topic:invalid union statements with DB2
Goto Forum:
  


Current Time: Thu Apr 18 03:37:20 GMT 2024

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

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

Back to the top