While using Papyrus (+Eclipse), I faced an issue that I initially considered as an inconsistency. But after wondering about it, I started to think that I may have a "bug" in my basic concepts of UML designing.
Well, consider the basic Class Inheritance problem where Man
and Woman
are specializations of Person
. (other words, Person
is a superclass of Man
and Woman
).
Then, if you apply a Stereotype Worker
(containing parameters job
and salary
, for example) to the Person
, shouldn't the subclasses also receive the same stereotype Worker
? Shouldn't they contain job
and salary
parameters?
I really though Stereotypes were also inherited from the superclass, but when I implement this design in Papyrus tool, I can't see any inherited job
or salary
. Every subclass is the same as if it didn't have any applied Stereotype.
Thanks in advance!
======================Edited for more information ========================
I found that an issue was opened in 2000 for the UML v1.3 regarding the inheritance of stereotypes in subclasses.
Issue 3210: Inheritance of Stereotypes (uml-rtf)
In my interpretation, the example provided in the Discussion is exactly what I asked above. However, it seems that the Reviewer understood that the issue was asking for subtype of Stereotype, and not propagation of Constraints from a stereotyped class to its subclasses.
This is the point added to the UML v1.3:
Stereotypes are GeneralizableElements. If a stereotype is a subtype of another stereotype, then it inherits all of the constraints and tagged values from its stereotype supertype and it must apply to the same kind of base class. A stereotype keeps track of the base class to which it may be applied.
Later on, it was deprecated in the UML v1.4 and removed in UML 2.
So, basically, according to my interpretation, the question existed... but the UML specs still don't specify it.