Home » Archived » M2M (model-to-model transformation) » [QVTO] Model migration / evolution
[QVTO] Model migration / evolution [message #91416] |
Mon, 06 October 2008 09:53  |
Eclipse User |
|
|
|
Hi all,
we have a quite large EMF model for our application, which already is
used in production. Now we have to change the model in an incompatible
way, for example move a reference from class A to class B. After that
change the old model instances are no longer readable by EMF, because
the xmi files refer to the removed reference of class A. So we need some
kind of transformation, that migrates our customers data from the old to
the new version.
What is a recommended way to deal with this sort of problem? Is QVTO the
right tool to migrate the model instances?
When I tried to do so with QVTO, I first tried the inplace
transformation. This did not work because the old an new models differ
and it was not possible to build a "super" model that contained all
features from the old and new version together (this was because we had
one reference that was a containment reference in the old version and in
the new version it was not).
I did not try the input/output transformation because I think I would
have to write a mapping for each of our classes (ca. 250 mappings). Is
there some kind of "reflection" in QVT that would allow to do this more
generically?
Thanks for any pointers,
Andreas
|
|
|
Re: [QVTO] Model migration / evolution [message #91433 is a reply to message #91416] |
Mon, 06 October 2008 09:59   |
Eclipse User |
|
|
|
Hi Andreas,
An option that comes to mind is to use a model-to-text transformation to
generate a first version of your model-to-model transformation from your
ECore model and then customize it manually to achieve exactly what you need.
Cheers,
Dimitrios
Andreas Voss wrote:
> Hi all,
>
> we have a quite large EMF model for our application, which already is
> used in production. Now we have to change the model in an incompatible
> way, for example move a reference from class A to class B. After that
> change the old model instances are no longer readable by EMF, because
> the xmi files refer to the removed reference of class A. So we need some
> kind of transformation, that migrates our customers data from the old to
> the new version.
>
> What is a recommended way to deal with this sort of problem? Is QVTO the
> right tool to migrate the model instances?
>
> When I tried to do so with QVTO, I first tried the inplace
> transformation. This did not work because the old an new models differ
> and it was not possible to build a "super" model that contained all
> features from the old and new version together (this was because we had
> one reference that was a containment reference in the old version and in
> the new version it was not).
>
>
> I did not try the input/output transformation because I think I would
> have to write a mapping for each of our classes (ca. 250 mappings). Is
> there some kind of "reflection" in QVT that would allow to do this more
> generically?
>
> Thanks for any pointers,
> Andreas
|
|
|
Re: [QVTO] Model migration / evolution [message #91448 is a reply to message #91416] |
Mon, 06 October 2008 10:20   |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Andreas,
EMF provides the Ecore2Ecore mappings and a ResourceHandler API for
exactly this model migration requirement. The MDT UML2 implementation
of the UML metamodel provides good examples of both of these mechanisms.
In fact, they are currently implementing more imcompatible changes in
adopting the UML 2.2 revision from OMG.
Have a look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=232332 for
details of their migration effort.
HTH,
Christian
Andreas Voss wrote:
> Hi all,
>
> we have a quite large EMF model for our application, which already is
> used in production. Now we have to change the model in an incompatible
> way, for example move a reference from class A to class B. After that
> change the old model instances are no longer readable by EMF, because
> the xmi files refer to the removed reference of class A. So we need some
> kind of transformation, that migrates our customers data from the old to
> the new version.
>
> What is a recommended way to deal with this sort of problem? Is QVTO the
> right tool to migrate the model instances?
>
> When I tried to do so with QVTO, I first tried the inplace
> transformation. This did not work because the old an new models differ
> and it was not possible to build a "super" model that contained all
> features from the old and new version together (this was because we had
> one reference that was a containment reference in the old version and in
> the new version it was not).
>
>
> I did not try the input/output transformation because I think I would
> have to write a mapping for each of our classes (ca. 250 mappings). Is
> there some kind of "reflection" in QVT that would allow to do this more
> generically?
>
> Thanks for any pointers,
> Andreas
|
|
|
Re: [QVTO] Model migration / evolution [message #91465 is a reply to message #91416] |
Mon, 06 October 2008 10:43   |
Eclipse User |
|
|
|
Hi Andreas,
Unfortunately, I do not think that QVTO is the right tool for this task.
You can't do this by using an inplace transf. as you can't modify the
metamodel
of your [inout] model within a transf execution.
In principal, you could transform a model that conforms to the old
metamodel to
a model that conforms to the new metamodel.
However, as you have mentioned, you need to write a lot of mappings, which
do nothing but a copy job. Considering a change in a single property
(for instance), this is not the way to go, IMO ;).
I propose you should ask in 'eclipse.tools.emf'.
Anyway, concerning your question on reflective approach, QVT defines a
mechanism for execution of QVT
AST conformant models by casting it to transformation type. See
'Model::asTransformation(Model) : Transformation' in the QVT spec.
You can write a generic transf that builds the QVT AST model of another
transf,
which actually does the real (copy) transformation job for 2 specific
metamodels,
the old -> new.
Such a generic transf could be the basis for any kind of migration, while
the generated one
is to be customized (extended) according to specific changes.
However, the generic approach requires a deep knowledge of QVT AST
metamodel and
mainly, it is not yet implemented by QVTO.
/Regards,
/Radek
On Mon, 06 Oct 2008 15:53:07 +0200, Andreas Voss <eclipse@a-voss.de> wrote:
> Hi all,
>
> we have a quite large EMF model for our application, which already is
> used in production. Now we have to change the model in an incompatible
> way, for example move a reference from class A to class B. After that
> change the old model instances are no longer readable by EMF, because
> the xmi files refer to the removed reference of class A. So we need some
> kind of transformation, that migrates our customers data from the old to
> the new version.
>
> What is a recommended way to deal with this sort of problem? Is QVTO the
> right tool to migrate the model instances?
>
> When I tried to do so with QVTO, I first tried the inplace
> transformation. This did not work because the old an new models differ
> and it was not possible to build a "super" model that contained all
> features from the old and new version together (this was because we had
> one reference that was a containment reference in the old version and in
> the new version it was not).
>
>
> I did not try the input/output transformation because I think I would
> have to write a mapping for each of our classes (ca. 250 mappings). Is
> there some kind of "reflection" in QVT that would allow to do this more
> generically?
>
> Thanks for any pointers,
> Andreas
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
| |
Goto Forum:
Current Time: Sun Jul 27 06:35:24 EDT 2025
Powered by FUDForum. Page generated in 0.04673 seconds
|