Skip to main content



      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 12:59 Go to next message
Eclipse UserFriend
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 14:53 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: An EMF model based on a super class [message #658086 is a reply to message #656562] Sun, 06 March 2011 00:18 Go to previous messageGo to next message
Eclipse UserFriend
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 11:01 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: An EMF model based on a super class [message #658507 is a reply to message #658109] Tue, 08 March 2011 14:05 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 13:49:03 EDT 2025

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

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

Back to the top