Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Operations and inheritance Ecore
Operations and inheritance Ecore [message #1266402] Fri, 07 March 2014 11:57 Go to next message
Peter Johnsen is currently offline Peter JohnsenFriend
Messages: 60
Registered: January 2012
Member
Hi,

I have a question regarding operations in EMF.

- Let's say I create an operation o( p : EInt) in X, and an operation o( p : EDate ) in Y, where Y is a subclass to X. Why is this legal (validates)?

- Let's say I create an operation o(): EInt in X, and an operation o() in Y, where Y is a subclass to X. Same question.

And how is overloading and overriding in EMF?

Any ideas? Smile

[Updated on: Fri, 07 March 2014 11:57]

Report message to a moderator

Re: Operations and inheritance Ecore [message #1266470 is a reply to message #1266402] Fri, 07 March 2014 13:57 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Peter,

Ecore's rules for inheritance and signature overloading are consistent
with Java.

In any case, you can always just try it to see what is generated: it
takes about 2 minutes in the Ecore and Genmodel editors! :-)

cW


On 2014-03-07 11:57:19 +0000, Peter Johnsen said:

> Hi,
>
> I have a question regarding operations in EMF.
>
> - Let's say I create an operation o( p : EInt) in X, and an operation
> o( p : EDate ) in Y, where Y is a subclass til X. Why is this legal
> (validates)?

These operation signatures are distinct in Java, so this is correct in Ecore.

>
> - Let's say I create an operation o(): EInt in X, and an operation o()
> in Y, where Y is a subclass til X. Same question.

If o() in Y has no return type (void), then this is not permitted
because in Java, void is not a subtype of int.


>
> And how is overloading and overriding in EMF?
>
> Any ideas? :)
Previous Topic:how to create a model compliant metamodel. ecore?
Next Topic:[CDO] Session not in sync after reconnect
Goto Forum:
  


Current Time: Tue Apr 16 06:51:23 GMT 2024

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

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

Back to the top