Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Newbie - generated class is extending interface not implementing
Newbie - generated class is extending interface not implementing [message #491739] Thu, 15 October 2009 15:55 Go to next message
Tony Bryan is currently offline Tony Bryan
Messages: 4
Registered: October 2009
Junior Member
Total, total newbie with UML/EMF.

Usign UML2 Tools I've created a simple interface with a single method "hello". A simple class has an interfaceRealization link to the interface.

I have created an EMF .gencode file from the .uml file, which shows "HelloClass -> Hello" (I presume this means HelloClass implements Hello).

When I generate the Java model I instead find that "HelloClass" is now an interface extending "Hello", rather than a class implementing "Hello".

Where am I going wrong?

Thanks,
Re: Newbie - generated class is extending interface not implementing [message #491766 is a reply to message #491739] Thu, 15 October 2009 17:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26036
Registered: July 2009
Senior Member
Tony,

Comments below.


Tony Bryan wrote:
> Total, total newbie with UML/EMF.
>
> Usign UML2 Tools I've created a simple interface with a single method
> "hello". A simple class has an interfaceRealization link to the
> interface.
>
> I have created an EMF .gencode file
*.genmodel?
> from the .uml file, which shows "HelloClass -> Hello" (I presume this
> means HelloClass implements Hello).
It's showing EClasses I guess?
>
> When I generate the Java model I instead find that "HelloClass" is now
> an interface extending "Hello", rather than a class implementing "Hello".
Every EClass X will always map to an interface X; that interface
typically has an implementation class XImpl. There's no such concept of
classes verses interfaces in Ecore, so don't expect it.
>
> Where am I going wrong?
Probably isn't an issue of expectations verses how it actually works.
>
> Thanks,
Re: Newbie - generated class is extending interface not implementing [message #491845 is a reply to message #491766] Fri, 16 October 2009 07:31 Go to previous message
Tony Bryan is currently offline Tony Bryan
Messages: 4
Registered: October 2009
Junior Member
Hi Ed,

Sorry - wrote my post in a total hurry. Yes, I meant .genmodel - realised that when I got home!

Yes, the .genmodel and .ecore structures both show EClasses:
- 'Hello' interface is an EClass, and has a single EOperation 'hello'
- 'HelloClass' in also an EClass.

Right - clearly I need to do more reading up... I did look at a few tutorials but have found it hard going. I'll read up some more - get my expectations sorted out.

Thanks Ed,
Tony
Re: Newbie - generated class is extending interface not implementing [message #624908 is a reply to message #491766] Fri, 16 October 2009 07:31 Go to previous message
Tony Bryan is currently offline Tony Bryan
Messages: 4
Registered: October 2009
Junior Member
Hi Ed,

Sorry - wrote my post in a total hurry. Yes, I meant .genmodel - realised that when I got home!

Yes, the .genmodel and .ecore structures both show EClasses:
- 'Hello' interface is an EClass, and has a single EOperation 'hello'
- 'HelloClass' in also an EClass.

Right - clearly I need to do more reading up... I did look at a few tutorials but have found it hard going. I'll read up some more - get my expectations sorted out.

Thanks Ed,
Tony
Previous Topic:How to remove "src" and "dst", and other questions
Next Topic:Create associations in profile definiton
Goto Forum:
  


Current Time: Mon Sep 15 04:12:35 GMT 2014

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

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