Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Multiple Inheritance
Multiple Inheritance [message #1148581] Mon, 21 October 2013 16:04 Go to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Hi,

I want to create a UML profile by EMF. In my metamodel, one of the classes inherits from two super classes. but when I want to define the profile, it gives me a message and it cannot be defined. Does any one know If it is possible to have multiple inheritance?

Thanks,
Mahin
Re: Multiple Inheritance [message #1148598 is a reply to message #1148581] Mon, 21 October 2013 16:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Manhin,

Comments below.

On 21/10/2013 6:04 PM, Mahin Abbasipour wrote:
> Hi,
>
> I want to create a UML profile by EMF.
It's best to ask about profiles on the UML2 forum.
> In my metamodel, one of the classes inherits from two super classes.
> but when I want to define the profile, it
What is "it"?
> gives me a message
What is the message?
> and it cannot be defined. Does any one know If it is possible to have
> multiple inheritance?
It's certainly possible in Ecore, but if it's a question about what's
allowed for UML2 profiles, that's a UML2 question and I don't know the
answer.
>
> Thanks,
> Mahin


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Multiple Inheritance [message #1148625 is a reply to message #1148598] Mon, 21 October 2013 16:37 Go to previous messageGo to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Hi,

thank you very much for your reply.

class DataRate is inheriting at the same time from classes Performance and NonfunctionalRequirement which are the extension of metaclass Class (base_Class: Class). UR is the name of defined UML profile. As far as I know, multiple inheritance is supported in UML2.

Diagnosis of UR
Processed inheritance of feature 'base_Class : Class' by class 'DataRate -> Performance, NonFunctionalRequirement' as a duplicate of feature 'base_Class : Class'.

Thanks,
Mahin
Re: Multiple Inheritance [message #1148677 is a reply to message #1148625] Mon, 21 October 2013 17:16 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Mahin,

Comments below.

On 21/10/2013 6:37 PM, Mahin Abbasipour wrote:
> Hi,
>
> thank you very much for your reply.
>
> class DataRate is inheriting at the same time from classes Performance
> and NonfunctionalRequirement which are the extension of metaclass
> Class (base_Class: Class). UR is the name of defined UML profile. As
> far as I know, multiple inheritance is supported in UML2.
>
> Diagnosis of UR
> Processed inheritance of feature 'base_Class : Class' by class
> 'DataRate -> Performance, NonFunctionalRequirement' as a duplicate of
> feature 'base_Class : Class'.
This message is being produced by what tool?
>
> Thanks,
> Mahin
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Multiple Inheritance [message #1148689 is a reply to message #1148677] Mon, 21 October 2013 17:29 Go to previous messageGo to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 24
Registered: June 2013
Junior Member
Hi,

I am using EMF and I create UML Profiles by creating a new UML Model in "Example EMF Model Creation Wizards".

Re: Multiple Inheritance [message #1148804 is a reply to message #1148625] Mon, 21 October 2013 19:08 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Mahin,

As Ed already indicated, this is a UML question and should be asked on
the UML2 newsgroup (which I copy on this reply).

See some replies in-line, below.

HTH,

Christian


On 2013-10-21 16:37:40 +0000, Mahin Abbasipour said:

> Hi,
>
> thank you very much for your reply.
>
> class DataRate is inheriting at the same time from classes Performance
> and NonfunctionalRequirement which are the extension of metaclass Class
> (base_Class: Class). UR is the name of defined UML profile. As far as I
> know, multiple inheritance is supported in UML2.

Stereotypes support multiple inheritance as any Class does, yes.


> Diagnosis of UR
> Processed inheritance of feature 'base_Class : Class' by class
> 'DataRate -> Performance, NonFunctionalRequirement' as a duplicate of
> feature 'base_Class : Class'.

This is quite expected. You have two stereotypes Performance and
NonfunctionalRequirement that both extend the Class metaclass, so of
course they both define a property named "base_Class". Now you have a
new stereotype DataRate that specializes both of these.

So, it inherits two distinct "base_Class" attributes. Which should be
used to actually apply this stereotype to a class? It is impossible
for the UML2 API to know. And the Ecore representation of the DataRate
stereotype isn't any happier.

However, I think the default behaviour of the UML-to-Ecore
transformation when you define your profile is to simply discard
duplicate attributes like this to resolve the conflict. The tool
notifies you when this happens, but I think the profile should actually
work. Does it not? Or are you just worried about this warning message?


>
> Thanks,
> Mahin
Previous Topic:Missing reference within EAnnotation in generated code
Next Topic:Does ChangeRecorder record inverted ChangeKind about ResourceChange?
Goto Forum:
  


Current Time: Thu Mar 28 12:57:48 GMT 2024

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

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

Back to the top