Re: Multiple Inheritance [message #1148805] |
Mon, 21 October 2013 19:08 |
|
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
|
|
|
|
Re: Multiple Inheritance [message #1149989 is a reply to message #1148990] |
Tue, 22 October 2013 12:59 |
|
Hi, Mahin,
I have attached a working example of what I understand to be your use case.
The StereoMI profile defines a steretype named 'AuxUtil' that
specializes Auxiliary and Utility from UML's StandardL2 profile. (it
appears that in your case, you are specializing stereotypes from MARTE)
Defining the profile yields this warning:
Processed inheritance of feature 'base_Class : Class - L2' by class
'AuxUtil -> Auxiliary, Utility' as a duplicate of feature 'base_Class :
Class - L2'.
which indicates that UML resolved the conflicting multiple feature inheritance.
I then loaded this profile into the editor of a test model, applied it,
and applied the AuxUtil stereotype successfully to a class.
So, assuming that this doesn't work for you, can you tell us what is
different in your scenario?
HTH,
Christian
On 2013-10-21 21:53:16 +0000, Mahin Abbasipour said:
> Hi,
>
> When I try to apply the defined profile which I got the message, It is
> not among the list of the loaded profiles, Although I loaded it before.
>
> Thanks a lot,
>
> Mahin
|
|
|
|
Powered by
FUDForum. Page generated in 0.02678 seconds