Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Multiple Inheritance: select which Impl java class will be used as superclass
Multiple Inheritance: select which Impl java class will be used as superclass [message #478300] Mon, 13 April 2009 14:30 Go to next message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello all,

I have a class (CustomElement) that inherits from PackageElement and from
one of my classes (BaseCustomElement). When CustomElementImpl is
generated, it has PackageableElement as superclass. Is there a way to
instruct the generator to use BaseCustomElementImplo as superclass?

Thanks in advance.
Best regards,
Cristi.
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #478305 is a reply to message #478300] Wed, 15 April 2009 15:27 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Cristian,

If you change the order of the ESuper Types in the ecore representation of
CustomElement such that BaseCustomElement appears first then it should work.
Select the 'CustomElement' in the tree view, then from the properties view
select 'ESuper Types' field. Use the 'Up' & 'Down' keys from the property
dialog to change the order.

Cheers,
- James.

"Cristian " <cristian607@yahoo.com> wrote in message
news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
> Hello all,
>
> I have a class (CustomElement) that inherits from PackageElement and from
> one of my classes (BaseCustomElement). When CustomElementImpl is
> generated, it has PackageableElement as superclass. Is there a way to
> instruct the generator to use BaseCustomElementImplo as superclass?
>
> Thanks in advance.
> Best regards,
> Cristi.
>
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #478306 is a reply to message #478305] Wed, 15 April 2009 15:34 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
.... from the .uml model, you can reorder your generalizations such that the
one for BaseCustomElement appears first using drag/drop in the tree editor.
When it comes time to convert the .uml model to .ecore, you will see an
option labeled 'Super Class Order'. Simply choose either 'ignore' or
'report' but *not* 'process'. If you choose 'process' it may reorder the
superclass order to optimize for code generation.

- James.


"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gs4u7f$959$1@build.eclipse.org...
> Hi Cristian,
>
> If you change the order of the ESuper Types in the ecore representation of
> CustomElement such that BaseCustomElement appears first then it should
> work.
> Select the 'CustomElement' in the tree view, then from the properties view
> select 'ESuper Types' field. Use the 'Up' & 'Down' keys from the
> property dialog to change the order.
>
> Cheers,
> - James.
>
> "Cristian " <cristian607@yahoo.com> wrote in message
> news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
>> Hello all,
>>
>> I have a class (CustomElement) that inherits from PackageElement and from
>> one of my classes (BaseCustomElement). When CustomElementImpl is
>> generated, it has PackageableElement as superclass. Is there a way to
>> instruct the generator to use BaseCustomElementImplo as superclass?
>>
>> Thanks in advance.
>> Best regards,
>> Cristi.
>>
>
>
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #478323 is a reply to message #478300] Thu, 23 April 2009 19:15 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Cristian,

If to set a keyword of "extend" on a generalization using
Element#addKeyword(String), the general class will become the base
superclass when the UML model is converted to Ecore.

Kenn

"Cristian " <cristian607@yahoo.com> wrote in message
news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
> Hello all,
>
> I have a class (CustomElement) that inherits from PackageElement and from
> one of my classes (BaseCustomElement). When CustomElementImpl is
> generated, it has PackageableElement as superclass. Is there a way to
> instruct the generator to use BaseCustomElementImplo as superclass?
>
> Thanks in advance.
> Best regards,
> Cristi.
>
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #627495 is a reply to message #478300] Wed, 15 April 2009 15:27 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Cristian,

If you change the order of the ESuper Types in the ecore representation of
CustomElement such that BaseCustomElement appears first then it should work.
Select the 'CustomElement' in the tree view, then from the properties view
select 'ESuper Types' field. Use the 'Up' & 'Down' keys from the property
dialog to change the order.

Cheers,
- James.

"Cristian " <cristian607@yahoo.com> wrote in message
news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
> Hello all,
>
> I have a class (CustomElement) that inherits from PackageElement and from
> one of my classes (BaseCustomElement). When CustomElementImpl is
> generated, it has PackageableElement as superclass. Is there a way to
> instruct the generator to use BaseCustomElementImplo as superclass?
>
> Thanks in advance.
> Best regards,
> Cristi.
>
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #627496 is a reply to message #478305] Wed, 15 April 2009 15:34 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
.... from the .uml model, you can reorder your generalizations such that the
one for BaseCustomElement appears first using drag/drop in the tree editor.
When it comes time to convert the .uml model to .ecore, you will see an
option labeled 'Super Class Order'. Simply choose either 'ignore' or
'report' but *not* 'process'. If you choose 'process' it may reorder the
superclass order to optimize for code generation.

- James.


"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gs4u7f$959$1@build.eclipse.org...
> Hi Cristian,
>
> If you change the order of the ESuper Types in the ecore representation of
> CustomElement such that BaseCustomElement appears first then it should
> work.
> Select the 'CustomElement' in the tree view, then from the properties view
> select 'ESuper Types' field. Use the 'Up' & 'Down' keys from the
> property dialog to change the order.
>
> Cheers,
> - James.
>
> "Cristian " <cristian607@yahoo.com> wrote in message
> news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
>> Hello all,
>>
>> I have a class (CustomElement) that inherits from PackageElement and from
>> one of my classes (BaseCustomElement). When CustomElementImpl is
>> generated, it has PackageableElement as superclass. Is there a way to
>> instruct the generator to use BaseCustomElementImplo as superclass?
>>
>> Thanks in advance.
>> Best regards,
>> Cristi.
>>
>
>
Re: Multiple Inheritance: select which Impl java class will be used as superclass [message #627512 is a reply to message #478300] Thu, 23 April 2009 19:15 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Cristian,

If to set a keyword of "extend" on a generalization using
Element#addKeyword(String), the general class will become the base
superclass when the UML model is converted to Ecore.

Kenn

"Cristian " <cristian607@yahoo.com> wrote in message
news:c97ef971080974a5deacb5743bc80dbe$1@www.eclipse.org...
> Hello all,
>
> I have a class (CustomElement) that inherits from PackageElement and from
> one of my classes (BaseCustomElement). When CustomElementImpl is
> generated, it has PackageableElement as superclass. Is there a way to
> instruct the generator to use BaseCustomElementImplo as superclass?
>
> Thanks in advance.
> Best regards,
> Cristi.
>
Previous Topic:Internal ordering of interaction fragments in a sequence diagram
Next Topic:Unable to add required property 'event' in ExecutionOccurrenceSpecification
Goto Forum:
  


Current Time: Thu Apr 25 10:41:07 GMT 2024

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

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

Back to the top