Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Mixed feature delegation across type hierarchy/genmodels
Mixed feature delegation across type hierarchy/genmodels [message #1053787] Tue, 07 May 2013 11:10 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 198
Registered: March 2012
Senior Member
Hi,

I have an upstream genmodel (class Parent) which uses FeatureDelegation=Reflective. Now, in my own genmodel/generated code (class Child extends Parent) I use EMF databinding to access/display the contents of derived features, which somehow seems to force me to set FeatureDelegation=Dynamic in my own genmodel. Afaiu this should work, but in the end it's probably more complicated than I think, thus the question:

Is such a "mixed" environment supported?

Thanks,
Felix
Re: Mixed feature delegation across type hierarchy/genmodels [message #1053789 is a reply to message #1053787] Tue, 07 May 2013 11:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25936
Registered: July 2009
Senior Member
Felix,

Comments below.

On 07/05/2013 5:10 PM, Felix Dorner wrote:
> Hi,
>
> I have an upstream genmodel (class Parent) which uses
> FeatureDelegation=Reflective. Now, in my own genmodel/generated code
> (class Child extends Parent) I use EMF databinding to access/display
> the contents of derived features, which somehow seems to force me to
> set FeatureDelegation=Dynamic in my own genmodel.
Somehow? I suppose you mean it doesn't work unless you set it to either
Reflective or Dynamic... I imagine that's because the base class will
have on override of eStaticFeatureCount which thereby will not allow a
derived class to introduce its own static features.
> Afaiu this should work, but in the end it's probably more complicated
> than I think, thus the question:
>
> Is such a "mixed" environment supported?
I think that should work okay to mix them, Reflective is no so different
from Dynamic, it just but the delegating to dynamic in the generated
accessors so that there is somewhere you can add hand written code to
intercept the calls, even when direct reflective calls are made...
>
> Thanks,
> Felix
Re: Mixed feature delegation across type hierarchy/genmodels [message #1053792 is a reply to message #1053789] Tue, 07 May 2013 11:37 Go to previous message
Felix Dorner is currently offline Felix Dorner
Messages: 198
Registered: March 2012
Senior Member
Hello Ed,

>> I have an upstream genmodel (class Parent) which uses
>> FeatureDelegation=Reflective. Now, in my own genmodel/generated code
>> (class Child extends Parent) I use EMF databinding to access/display
>> the contents of derived features, which somehow seems to force me to
>> set FeatureDelegation=Dynamic in my own genmodel.
>Somehow? I suppose you mean it doesn't work unless you set it to either
>Reflective or Dynamic... I imagine that's because the base class will
>have on override of eStaticFeatureCount which thereby will not allow a
>derived class to introduce its own static features.

Sorry, somehow is not very precise. Before I had it set to "Reflective". In that case calling eGet(aDerivedStructuralFeature) would simply return an empty list, the invocation was simply not wired to the implementation method. When setting feature delegation to "Dynamic", eGet() is generated differently and now calls the implementation (like in native EMF).

>> Is such a "mixed" environment supported?

>I think that should work okay to mix them, Reflective is no so different
>from Dynamic, it just but the delegating to dynamic in the generated
>accessors so that there is somewhere you can add hand written code to
>intercept the calls, even when direct reflective calls are made...

That's why I also guessed it should work.

Thanks again for your superfast (like always!) answer.
Felix
Previous Topic:local language writting issue
Next Topic:[Teneo] session refresh throws UnresolvableObjectException: No row with the given identifier exists
Goto Forum:
  


Current Time: Tue Jul 29 02:44:12 EDT 2014

Powered by FUDForum. Page generated in 0.02332 seconds