Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Migrate Model to updated Metamodel with Java
Migrate Model to updated Metamodel with Java [message #1597451] Mon, 02 February 2015 09:51 Go to next message
Thomas Busch is currently offline Thomas BuschFriend
Messages: 23
Registered: November 2014
Junior Member
Hi,

I am searching for an effective way to migrate models from one metamodel to a slightly changed new metamodel. I was thinking about a plain java approach, maybe a recursive function which just copies the objects 1:1 except for the objects which have been changed at the newer metamodel.

Does someone has some experience or ideas how to solve this problem with java without rebuilding the whole modelstructure manually in the code? (So you just have to program the object-translations which have changed and not all objects and relations)

Thank you!
Re: Migrate Model to updated Metamodel with Java [message #1597652 is a reply to message #1597451] Mon, 02 February 2015 12:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

Option 1: Use a domain-specific transformation language for migration:
e.g Epsilon's Flock; you get helpful operators and defaults.

Option 2: Use the source *.ecore metamodel to drive the auto-generation
of an abstract meta-transformation in your favourite transformation
language that you can customize/override. If you're lucky the
auto-generated xxxSwitch might be close.

Regards

Ed Willink


On 02/02/2015 09:51, Thomas Busch wrote:
> Hi,
>
> I am searching for an effective way to migrate models from one
> metamodel to a slightly changed new metamodel. I was thinking about a
> plain java approach, maybe a recursive function which just copies the
> objects 1:1 except for the objects which have been changed at the
> newer metamodel.
>
> Does someone has some experience or ideas how to solve this problem
> with java without rebuilding the whole modelstructure manually in the
> code? (So you just have to program the object-translations which have
> changed and not all objects and relations)
>
> Thank you!
Re: Migrate Model to updated Metamodel with Java [message #1598106 is a reply to message #1597652] Mon, 02 February 2015 19:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30544
Registered: July 2009
Senior Member
Often a specialized EcoreUtil.Copier is very effective. For Oomph we
annotated a dynamic version of the old model to specify how to create
instances of the new model. You might look at
org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.Migrator.MigrationCopier
as an example.

On 02.02.2015 13:58, Ed Willink wrote:
> Hi
>
> Option 1: Use a domain-specific transformation language for migration:
> e.g Epsilon's Flock; you get helpful operators and defaults.
>
> Option 2: Use the source *.ecore metamodel to drive the auto-generation
> of an abstract meta-transformation in your favourite transformation
> language that you can customize/override. If you're lucky the
> auto-generated xxxSwitch might be close.
>
> Regards
>
> Ed Willink
>
>
> On 02/02/2015 09:51, Thomas Busch wrote:
>> Hi,
>>
>> I am searching for an effective way to migrate models from one
>> metamodel to a slightly changed new metamodel. I was thinking about a
>> plain java approach, maybe a recursive function which just copies the
>> objects 1:1 except for the objects which have been changed at the
>> newer metamodel.
>>
>> Does someone has some experience or ideas how to solve this problem
>> with java without rebuilding the whole modelstructure manually in the
>> code? (So you just have to program the object-translations which have
>> changed and not all objects and relations)
>>
>> Thank you!
>
Re: Migrate Model to updated Metamodel with Java [message #1598112 is a reply to message #1598106] Mon, 02 February 2015 19:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30544
Registered: July 2009
Senior Member
You might look at the Edapt project as well.

On 02.02.2015 20:56, Ed Merks wrote:
> Often a specialized EcoreUtil.Copier is very effective. For Oomph we
> annotated a dynamic version of the old model to specify how to create
> instances of the new model. You might look at
> org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.Migrator.MigrationCopier
> as an example.
>
> On 02.02.2015 13:58, Ed Willink wrote:
>> Hi
>>
>> Option 1: Use a domain-specific transformation language for migration:
>> e.g Epsilon's Flock; you get helpful operators and defaults.
>>
>> Option 2: Use the source *.ecore metamodel to drive the auto-generation
>> of an abstract meta-transformation in your favourite transformation
>> language that you can customize/override. If you're lucky the
>> auto-generated xxxSwitch might be close.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 02/02/2015 09:51, Thomas Busch wrote:
>>> Hi,
>>>
>>> I am searching for an effective way to migrate models from one
>>> metamodel to a slightly changed new metamodel. I was thinking about a
>>> plain java approach, maybe a recursive function which just copies the
>>> objects 1:1 except for the objects which have been changed at the
>>> newer metamodel.
>>>
>>> Does someone has some experience or ideas how to solve this problem
>>> with java without rebuilding the whole modelstructure manually in the
>>> code? (So you just have to program the object-translations which have
>>> changed and not all objects and relations)
>>>
>>> Thank you!
>>
>
Re: Migrate Model to updated Metamodel with Java [message #1598994 is a reply to message #1598112] Tue, 03 February 2015 09:53 Go to previous message
Thomas Busch is currently offline Thomas BuschFriend
Messages: 23
Registered: November 2014
Junior Member
edapt seems to be a nice tool, but I am looking for a tool that is able to do transforms between totally different metamodels as well as transforms to "updated" metamodels. Also thanks for the EcoreUtil example!

Ed Willink, do you know an example or tutorial for your option 2, the abstract meta-transformation?
Previous Topic:Modeling Symposium EclipseCon North America 2015
Next Topic:[CDO] Ecore model inheritance [solved]
Goto Forum:
  


Current Time: Tue Oct 15 13:40:45 GMT 2019

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

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

Back to the top