|
Re: Mixed feature delegation across type hierarchy/genmodels [message #1053789 is a reply to message #1053787] |
Tue, 07 May 2013 15:19 |
Ed Merks Messages: 33142 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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Mixed feature delegation across type hierarchy/genmodels [message #1053792 is a reply to message #1053789] |
Tue, 07 May 2013 15:37 |
Felix Dorner Messages: 295 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
|
|
|
Powered by
FUDForum. Page generated in 0.04202 seconds