are stereotypes inherited?

Discussions about UML in general.

are stereotypes inherited?

Postby jsimmond@vub.ac.be » Wed Dec 17, 2003 7:45 pm

are stereotypes inherited?
Jocelyn Simmonds
jsimmond@vub.ac.be
 
Posts: 13
Joined: Tue Mar 11, 2003 12:46 pm
Location: Santiago, Chile

Re: are stereotypes inherited?

Postby [gw] Stefan Mueller » Fri Dec 19, 2003 12:36 pm

Hi,

generalizable elements (like classes) inherits the sterotypes from their parents.
And stereotypes themself are generalizable elements, which means a sterotype can inherit from another stereotype.

Kind regards,

Stefan
Stefan Mueller [Gentleware]
[gw] Stefan Mueller
 
Posts: 374
Joined: Thu Jul 03, 2003 11:24 am

Re: are stereotypes inherited?

Postby Guest » Mon Dec 22, 2003 11:03 am

Dear Stefan,

I was curious as well to what the answer would be to this question. The second part, about stereotype being an GeneralizableElement is of course correct. The first part of your answer "generalizable elements (like classes) inherits the sterotypes from their parents" is what I would have thought as well. However, I decided to look it up in the UML 1.4 specification (http://www.omg.org/cgi-bin/doc?formal/01-09-67), and now I'm not so sure anymore.

In par. 2.5.4.4 ("Inheritance"), page 2-70, it is stated that:
"Each kind of generalizable element has a set of inheritable features. For any model element, these include constraints. For classifiers, these include features (attributes, operations, signal receptions, and methods) and participation in associations."

From the text of the specification it seems that stereotypes are not perse part of the inheritable features. On the other hand the Liskov substition principle still must hold. In my opinion this means that when a stereotype imposes additional constraints on a parent element, the same constraints, or stronger, must hold true for the child. Therefore my answer would be:

"If a stereotype imposes a constraint on a parent modelelement, the same stereotype, or a child of that stereotype, will be applicable to the child modelelement. If there are no constraints associated with a stereotype, the stereotype is not inherited."

Would you agree on this interpretation ?

Kind regard,

Mick Baggen
Guest
 


Return to UML

Who is online

Users browsing this forum: No registered users and 2 guests

cron