|Re: dynamically add features to model object [message #629820 is a reply to message #629731]
||Wed, 29 September 2010 16:03
| Ed Merks
Registered: July 2009
Comments below. Please use the EMF newsgroup/forum (eclipse.tools.emf)
for questions like this.
Flavio Donzé wrote:
> I'm using EMF and Teneo to persist my model objects.
> I'm facing a problem and was wondering if anybody has done something
> I have to dynamically add features to an existing model object.
> causes eGet and eSet to fail.
Yes, you can't do that.
> I tried to dynamically create a new model object that extends my
> current one as described in the EMF Book "14.3. Dynamic EMF".
> The problem here is that eClass().getName() then is not equal to the
> name I have in my original eClass.
I suppose you could make the names the same, but I doubt that would
eliminate all issues...
> If I use the same name, teneo complains that the table already exists,
> which totally makes sense.
> Anybody has a idea, reference or hint on how I should accomplish this?
You should not expect to be able to dynamically change models just as
you shouldn't expect to be able to dynamically change how many rows are
in a table.
> Maybe it is really easy and I'm on the wrong path...
I think taking a step back and asking what exactly are the dynamic needs
would be good. Many models have some type of extensibility feature,
e.g., annotations in XML Schema, Java, and Ecore. I.e., they allow
instances to be decorated, but they don't allow the model itself to be
changed or extended.
Powered by FUDForum
. Page generated in 0.02310 seconds