Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Why EModelElement doesn't inherit from EObject?
Why EModelElement doesn't inherit from EObject? [message #890288] Thu, 21 June 2012 18:47 Go to next message
Marc Gil is currently offline Marc GilFriend
Messages: 190
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hello everybody,

I realized that since at least Indigo release, EModelElement doesn't inherit from EObject element in the Metamodel. Nevertheless, in the generated code EModelElement extends from EObject.

That's a problem, due to for instance XPand transformations doesn't work fine with this change. To solve this problem in XPand, I needed to change eContainer() calls by eContainer. In other words: access directly to the attribute instead of using the function.

Maybe there're other parts of code or transformations where this is a big problem.

Is it correct or is it a bug? If it's a bug, maybe it could be resolved in the Juno final release?

I create a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383265

Thanks a lot.
Marc
Re: Why EModelElement doesn't inherit from EObject? [message #890294 is a reply to message #890288] Thu, 21 June 2012 19:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
HI

This change was made in Helios M4 for pragmatic bloat reasons that
coincide with more accurately reflecting the modeling perspective.

In OCL/Acceleo/QVTo you can oclAsType(ecore::EObject) to cast to where
the names are visible.

Regards

Ed Willink



On 21/06/2012 19:47, Marc wrote:
> Hello everybody,
>
> I realized that since at least Indigo release, EModelElement doesn't
> inherit from EObject element in the Metamodel. Nevertheless, in the
> generated code EModelElement extends from EObject.
>
> That's a problem, due to for instance XPand transformations doesn't
> work fine with this change. To solve this problem in XPand, I needed
> to change eContainer() calls by eContainer. In other words: access
> directly to the attribute instead of using the function.
>
> Maybe there're other parts of code or transformations where this is a
> big problem.
>
> Is it correct or is it a bug? If it's a bug, maybe it could be
> resolved in the Juno final release?
>
> I create a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383265
>
> Thanks a lot.
> Marc
Re: Why EModelElement doesn't inherit from EObject? [message #890295 is a reply to message #890294] Thu, 21 June 2012 19:21 Go to previous messageGo to next message
Marc Gil is currently offline Marc GilFriend
Messages: 190
Registered: July 2009
Location: Valencia, Spain
Senior Member
So it's not a bug... Nevertheless I don't understand the reason it was done... cause in the generated code it stills extends from EObject...

But thanks for your response Ed.
Marc
Re: Why EModelElement doesn't inherit from EObject? [message #890376 is a reply to message #890295] Fri, 22 June 2012 07:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30351
Registered: July 2009
Senior Member
Marc,

All the generated eInvoke methods for the EModelElement hierarchy, which
includes GMF's Notation model and UML2, would have a large dispatching
switch for all of EObject's operations. But it should never be
necessary or even usual, to eInvoke EObject's operations because all
generated implementation classes implement EObject anyway so you can
always cast to EObject and call its method without eInvoke support.

On 21/06/2012 3:21 PM, Marc wrote:
> So it's not a bug... Nevertheless I don't understand the reason it was
> done... cause in the generated code it stills extends from EObject...
>
> But thanks for your response Ed.
> Marc
Re: Why EModelElement doesn't inherit from EObject? [message #890378 is a reply to message #890376] Fri, 22 June 2012 07:24 Go to previous message
Marc Gil is currently offline Marc GilFriend
Messages: 190
Registered: July 2009
Location: Valencia, Spain
Senior Member
Hi Ed,

thanks a lot for your reply. I also saw your reply in the bug, so now I understand the reason you did it.
Marc
Previous Topic:problem: build emf project
Next Topic:Xfeature
Goto Forum:
  


Current Time: Sun Aug 18 10:56:20 GMT 2019

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

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

Back to the top