[XCore] derived feature, manual code [message #912025] |
Wed, 12 September 2012 20:14 |
M. Herrmann Messages: 25 Registered: March 2010 |
Junior Member |
|
|
Hi,
this might be a noob question, but concerning EMF and XCore I AM probably a noob
Lets say I have this in XCore:
class Entity {
transient derived String entityId get {
// do something to get the value and return it
}
}
And I also have
featureDelegation="Reflective" in the @GenModel properties.
If I look at the genrated getter in "EntityImpl", it does not contain the code specified in XCore but a call to "eGet" instead (actually I expected that)
Since I cannot change the generated code, how do I implement my custom code for the derived feature?
Let me add: I would really like it to be a feature, not use an operation instead.
I am forced to use featureDelegation="Reflective"
Something else:
Could you give me a hint how to use the "generation gap" pattern with XCore?
Especially how to get the factories to create my custom class instead of the generated class? Of course without manually changing the generated code.
Thanks for your help
[Updated on: Wed, 12 September 2012 20:26] Report message to a moderator
|
|
|
|
|
Re: [XCore] derived feature, manual code [message #912224 is a reply to message #912183] |
Thu, 13 September 2012 06:47 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Yes, although for dynamic delegation, reflective calls to eGet will
bypass any logic in the generated accessors, so that doesn't really work
well even if we generate the body properly. For reflective delegation
is should be supported because it's properly supported when you hand
modify the generated implementation. Your problem is related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385634. But this is a
little trickier because the implementation should be in the basicGet and
it shouldn't resolve the proxy.
On 13/09/2012 7:13 AM, M. Herrmann wrote:
> So intention is, that the body specified in the XCore overrides any
> default implementation, no matter what type of featureDelegation?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03027 seconds