I'm confused about the difference between something being a "stereotype" and being a "superclass" in UML.
Let's say I want to create a diagram involving a "WidgetMaker." WidgetMaker is clearly an Actor so the UML standard is to stereotype it actor:
<<Actor>> WidgetMaker
But I grew up programming in the Java/Ruby/C++ world. In that world, the relationship is:
class Actor
end
class WidgetMaker < Actor
end
That looks like this in UML:
Actor
^
|
WidgetMaker
So my question is: why does UML have stereotypes at all when you can just as easily model those concepts using class inheritance, which it also has.
Once we have more "kinds" of actors, the question becomes even murkier:
Actor
^
|
------------------------
| | |
Person Robot Group
^
|
WidgetMaker
versus
<<Actor>> <<Person>> WidgetMaker
A Stereotype is there and used to present more information about the artifact which the documentation or the Classification of the same into a specific block of artifacts may not give. For example, you have identified a Data Class, you might give it the name, explain the attributes and the operations but that itself may not give the full information.The moment you Stereotype it as <>, it specifies full information; Until then it continues as any other class to a developer.
"Stereotypes are used to extend the UML notational elements, to classify and extend associations, inheritance relationships, classes, and components"
A Stereotype provides the capability to create new kind of modeling elements. Stereotypes must be based on elements that are part of the UML meta-model. Some common stereotypes for a class are entity, boundary, control, utility and exception. The stereotype for a class is shown below the class name enclosed in guillemets (i.e.
«and», pronounced gee-may). If desired a graphic icon or a specific color may be associated with a stereotype.