Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Changing the Meta Model while there are Instances
Changing the Meta Model while there are Instances [message #419737] Wed, 04 June 2008 15:59 Go to next message
Moritz Eysholdt is currently offline Moritz EysholdtFriend
Messages: 161
Registered: July 2009
Location: Kiel, Germany
Senior Member
Hi,

I know this is probably a stupid questions, but I have to ask it anyway
since I have to be very sure about the answer.

Is it possible to edit the meta model (ecore) while there are instances
(models) of it? As far as I know the MM is marked read-only as soon as
there are instanes of it... but is there any way to avoid it? I know
that this would require to adapt the instance at the same time, which
might be tricky.

So is there any other answer except "Meta models must not change while
there are models! Use a m2m-transformation to copy the model from the
untouched meta model to the changed meta model!"?

I'm implementing a concept to handle meta model evolution and changes
between different meta model version are described by the operations
that cause the changes. So if I apply one of these operations, the most
performant way would be to change the model simultaneusly.

regards,
Moritz
Re: Changing the Meta Model while there are Instances [message #419742 is a reply to message #419737] Wed, 04 June 2008 16:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Moritz,

Comments below.

Moritz Eysholdt wrote:
> Hi,
>
> I know this is probably a stupid questions, but I have to ask it
> anyway since I have to be very sure about the answer.
>
> Is it possible to edit the meta model (ecore) while there are
> instances (models) of it?
It's possible in that nothing prevents you, but it's a very bad idea
that will result in undefined behavior.
> As far as I know the MM is marked read-only as soon as there are
> instanes of it... but is there any way to avoid it? I know that this
> would require to adapt the instance at the same time, which might be
> tricky.
As a general case, it's totally tricky. Imagine removing the feature
that defines your containment relationship with your parent....
>
> So is there any other answer except "Meta models must not change while
> there are models! Use a m2m-transformation to copy the model from the
> untouched meta model to the changed meta model!"?
Certainly you can often read a serialization of an older model's
instance with a newer version of the model, given the changes are
additive...
>
> I'm implementing a concept to handle meta model evolution and changes
> between different meta model version are described by the operations
> that cause the changes. So if I apply one of these operations, the
> most performant way would be to change the model simultaneusly.
I know some folks have done funky stuff to allow they to add features.
There's even https://bugs.eclipse.org/bugs/show_bug.cgi?id=177107 open
already. In instance of the list returned by
EClass.getEAllStructuralFeatures changes when features are added, so one
could use that difference to reconcile an instance's data against a new
version of the EClass; the Visual Editor folks did this. Or one could
store property values using a map so that feature additions would have
no impact...
>
> regards,
> Moritz


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Changing the Meta Model while there are Instances [message #419746 is a reply to message #419737] Wed, 04 June 2008 18:25 Go to previous message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
Hello Moritz,

It might be possible to setup a transformation which refactors the metamodel
as well as the models instances using the "Tiger EMF Transformation
Project".

http://tfs.cs.tu-berlin.de/emftrans/

Enrico

Moritz Eysholdt wrote:
> Hi,
>
> I know this is probably a stupid questions, but I have to ask it anyway
> since I have to be very sure about the answer.
>
> Is it possible to edit the meta model (ecore) while there are instances
> (models) of it? As far as I know the MM is marked read-only as soon as
> there are instanes of it... but is there any way to avoid it? I know
> that this would require to adapt the instance at the same time, which
> might be tricky.
>
> So is there any other answer except "Meta models must not change while
> there are models! Use a m2m-transformation to copy the model from the
> untouched meta model to the changed meta model!"?
>
> I'm implementing a concept to handle meta model evolution and changes
> between different meta model version are described by the operations
> that cause the changes. So if I apply one of these operations, the most
> performant way would be to change the model simultaneusly.
>
> regards,
> Moritz
Previous Topic:ArrayIndexOutOfBoundsException during XMLHandler.handleForwardReferences
Next Topic:Tracking resource changes using AdapterFactoryContentProvider
Goto Forum:
  


Current Time: Tue Apr 16 20:43:13 GMT 2024

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

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

Back to the top