Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] Defining get on derived features using reflective feature delegation
[Xcore] Defining get on derived features using reflective feature delegation [message #990824] Fri, 14 December 2012 11:04 Go to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 450
Registered: December 2010
Location: Germany
Senior Member
Hello

is it possible to define get for features when reflective (or dynamic) feature delegation is used?

Example:
@GenModel(featureDelegation="Reflective")
class MyClass {
	String name
	String firstName
	derived String fullName get {
		name + ", " + firstName
	}
}

My tests show that this is not implemented using EMF 2.8.1 and Xcore 1.0.1. Are there any plans to support this?

Greetings
Christoph
Re: [Xcore] Defining get on derived features using reflective feature delegation [message #990829 is a reply to message #990824] Fri, 14 December 2012 11:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 27481
Registered: July 2009
Senior Member
Christoph,

Yes, this problem is related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385634. The guards for
when to emit the body verses what's generated otherwise is a little too
far down in the template. Perhaps you can append this example to that
bug to remind me that it needs attention; it shouldn't be too hard to fix...


On 14/12/2012 12:04 PM, Christoph Keimel wrote:
> @GenModel(featureDelegation="Reflective")
> class MyClass {
> String name
> String firstName
> derived String fullName get {
> name + ", " + firstName
> }
> }
Re: [Xcore] Defining get on derived features using reflective feature delegation [message #1721295 is a reply to message #990829] Tue, 26 January 2016 11:56 Go to previous messageGo to next message
Maged Elaasar is currently offline Maged ElaasarFriend
Messages: 10
Registered: September 2013
Junior Member
Hi Ed,

I have Xcore (1.2) model with a derived attribute that has a custom getter. When I set feature delegation to Dynamic (as recommended for CDO), the generated code has an eGet method calling the generated getX method. However, the latter calls eDynamicGet, and does not have the custom code from the Xcore model as I would have expected (note that I only get the custom code emitted when I set feature delegation to None or Reflective).

What setting do I need to have to get the custom code in xcore to be emitted with Dynamic delegation? Thanks.

Maged

[Updated on: Tue, 26 January 2016 11:57]

Report message to a moderator

Re: [Xcore] Defining get on derived features using reflective feature delegation [message #1721297 is a reply to message #1721295] Tue, 26 January 2016 12:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 27481
Registered: July 2009
Senior Member
Maged,

That sounds like a bug. Please open a Bugzilla.

On 26.01.2016 12:56, Maged Elaasar wrote:
> Hi Ed,
>
> I have Xcore (1.2) model with a derived attribute that has a custom
> getter. When I set feature delegation to Dynamic (as recommended for
> CDO), the generated code has an eGet method calling the generated getX
> method. However, the latter calls eDynamicGet, and does not have the
> custom code from the Xcore model as I would have expected (note that I
> only get the custom code emitted when I set feature delegation to None
> or Reflective).
>
> What setting do I need to have to get the custom code in xcore to be
> edited with Dynamic delegation? Thanks.
>
> Maged
Re: [Xcore] Defining get on derived features using reflective feature delegation [message #1721361 is a reply to message #1721297] Tue, 26 January 2016 20:09 Go to previous message
Maged Elaasar is currently offline Maged ElaasarFriend
Messages: 10
Registered: September 2013
Junior Member
Here it is: https://bugs.eclipse.org/bugs/show_bug.cgi?id=486601

Thanks Ed.
Previous Topic:Thanks for the version management tool
Next Topic:[CDO] Missing class when running CDOServer
Goto Forum:
  


Current Time: Wed Jun 01 05:39:16 GMT 2016

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

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