Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » An EMF model based on a super class(Can it be done?)
An EMF model based on a super class [message #656555] Sat, 26 February 2011 17:59 Go to next message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
Is there a way to build an ecore diagram that can inherit from an already existing class?

I would like to build a model, but the parent class in my model will extend an already existing class (one I did not create).

Thanks,
Herb Miller
Re: An EMF model based on a super class [message #656562 is a reply to message #656555] Sat, 26 February 2011 19:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Herb,

Yes, you just need to load the other model into the editor. You should
be able to do that from the outline view.


Herb Miller wrote:
> Is there a way to build an ecore diagram that can inherit from an
> already existing class?
>
> I would like to build a model, but the parent class in my model will
> extend an already existing class (one I did not create).
>
> Thanks,
> Herb Miller


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: An EMF model based on a super class [message #658086 is a reply to message #656562] Sun, 06 March 2011 05:18 Go to previous messageGo to next message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
I can tell from your reply that there is a way to do it, I just do not understand it yet. Let me be more specific.

I am working through the new RCP book. Section 5.3 has a chat model. The model in the book is simple, so I implented it in code. Then I thought, why not use EMF to implement this model.

Then I looked in the code for that chapter, and one of the parent classes of the model actually inherits from an existing Eclipse object named PlatformObject. I don't really have another model to add into the editor.

So, did you answer my question and I just missed it, or is my question more clear now?

Thanks,
Herb Miller
Re: An EMF model based on a super class [message #658109 is a reply to message #658086] Sun, 06 March 2011 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Herb,

Comments below.

Herb Miller wrote:
> I can tell from your reply that there is a way to do it, I just do not
> understand it yet. Let me be more specific.
>
> I am working through the new RCP book. Section 5.3 has a chat model.
> The model in the book is simple, so I implented it in code. Then I
> thought, why not use EMF to implement this model.
>
> Then I looked in the code for that chapter, and one of the parent
> classes of the model actually inherits from an existing Eclipse object
> named PlatformObject. I don't really have another model to add into
> the editor.
That's a little different question. EMF's implementation classes must
extends a subclass of BasicEObjectImpl (in order to implementation
EObject and InternalEObject). So they can't extend some other class
like PlatformObject. YOu can however define an EClass to wrap an
existing interface, like IAdaptable, but setting the instance type name
of the fully qualified name of the interface and marking it as interface
true. You can then use that in the eSuperTypes of any other EClass and
implement the methods needed in the generated implementation classes.
(You could even define the EOperations of the wrapped interface in the
wrapper EClass so that stubs are generated.)
>
> So, did you answer my question and I just missed it, or is my question
> more clear now?
More clear now.
>
> Thanks,
> Herb Miller
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: An EMF model based on a super class [message #658507 is a reply to message #658109] Tue, 08 March 2011 19:05 Go to previous message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
Well, that is not the answer I was hoping for, but at least I learned something.

Thanks,
Herb Miller
Previous Topic:Custom serialization without XSD ?
Next Topic:Missing EMF Menu Entries
Goto Forum:
  


Current Time: Thu Apr 25 03:32:43 GMT 2024

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

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

Back to the top