Re: FW: Stereotyping one more question



Date view Thread view Subject view Author view

Joaquin Miller (miller@joaquin.net)
Tue, 12 Feb 2002 12:26:27 -0800


Guy Genilloud wrote: >Joaquin, > >Is there a difference in your mind between "to constrain the >specification" and "to restrict an association"? > >You wrote 1) >(Actually, use of a stereotype to constrain the specification is simply >wrong, though popular. We can blame its popularity on the use of >stereotypes in the UML specification to constrain the model there (the UML >metamodel).) >... > >AND 2) > So use of a stereotype to restrict an association in UML 1 is fine. > >Guy This was very sloppy of me. I should have written: >(Actually, use of a stereotype to constrain an element of a UML model is >simply wrong, though popular. We can blame its popularity on the use of >stereotypes in the UML specification to constrain the model there (the UML >metamodel).) > So use of a stereotype to restrict the meaning of UML association in UML > 1 is fine. Then, to make this clearer, i should have added: The point about proper use of stereotypes is this: in UML 1, a stereotype makes a change to the UML language definition: definition of a stereotype declares a new kind of UML model element; application of that stereotype declares that the model element to which it is applied is not what it seems, a standard UML model element, but a specialization of that kind of model element. Use of a stereotype to restrict the meaning of UML association in UML 1 is fine. Notice that there is only one indefinite article in that sentence. It is the UML concept, association, that is restricted, not a particular association. Use of a (restricting) stereotype on a UML association in a UML 1 model restricts the meaning of 'association' in the UML language: the stereotyped association is not simply a standard UML 1 association, but a special, new kind of model element, which is like a UML association, but with some restriction(s). For example, a stereotype could be applied to an association that had an open or white diamond on it, to specify that this is a grey diamond association, more restricted than the white diamond association, but not as restricted as the black diamond association. (Again, and of course, many, perhaps most, such specifications are better done directly in the UML model, instead of by changing the language through the use of stereotypes. A proper use of a grey diamond stereotype might add some tagged value that provided for inclusion in the model of additional information about the association.) Here is a more specific (and so, better) example: UML 1 provides n-ary associations. As has been well known for many years, in order to fully specify an n-ary association, it is necessary to specify both inner and outer multiplicities. This is impossible in UML 1. A modeler might specify a stereotype for associations that added to the UML specification of the association model element a set of tagged values that allowed the modeler to store a second set of association multiplicities. [ For more on this, see: Gonzalo Genova, Juan Llorenz, Paloma Martinez, Semantics of the Minimum Multiplicity in Ternary Associations in UML, Proceedings of UML 2001, Lecture Notes in Computer Science 2185, Berlin: Springer, 2001 ISBN 3-540-42667-1 ]


Date view Thread view Subject view Author view