UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Clarification needed about the semantics of stereotype specialization and stereotype application

  • Key: UMLR-444
  • Legacy Issue Number: 18706
  • Status: open  
  • Source: NASA ( Dr. Nicolas F. Rouquette)
  • Summary:

    Many profiles define stereotypes that specialize other stereotypes.
    UML 2.5 does this in two places:

    • UML 2.5, section 12.3.5 Examples, Figure 12.19 where the Entity and
      Session stereotypes specialize the Bean stereotype
    • UML2.5, section 22 StandardProfile, Figure 22.1 where the File
      stereotype has several specializations (Document, Executable, Š)

    The UML specification does not explicitly define a the semantics of
    stereotype specialization, particularly with respect to stereotype
    application.
    This puts UML users and UML tool vendors in the difficult position to
    interpret the UML specification to come up with such a semantics.
    Given the popularity of UML profiles in practice, the UML specification
    must explain this clearly.

    I propose using the UML semantics of classifier generalization as a
    guiding principle for specifying the semantics of stereotype
    specialization and application; that is:

    1) If a stereotype S2 specializes S1, then the semantics of S2 must be
    consistent with the semantics of S1.
    2) Given (1), the semantics of applying S2 to X must be consistent with
    the semantics of applying S1 to X.
    3) Given (1) and (2), it must be possible to define S2 in several ways:

    3a) S2 specializes S1; S1 is abstract and does not define any extension;
    S2 extends Classifier.

    There is only one property: S2::base_Classifier.
    It is not possible to apply S1 because it is abstract.
    Only S2 can be applied.

    3b) S2 specializes S1 but S2 does not define its own extension; instead,
    it inherits S1's "base_" property or properties.

    It is possible to apply S1 or S2 or both to the same element.
    The semantics should be consistent regardless of whether S1 only, S2 only
    or S1 and S2 are applied.

    3c) S2 specializes S1 and defines its own extension(s) by specializing
    S1's extension relationships and redefining the extension ends.

    For example, suppose S1 extends Classifier, then S1 has a property:
    S1::base_Classifier.
    Then, if S2 extends Classifier, the extension between S2 and Classifier
    specializes the extension between S1 and Classifier with redefinitions on
    both sides.
    That is, S2::base_Classifier

    { redefines S1::base_Classifier }

    This ensures that the semantics of applying S1 only to a Classifier is
    consistent with the semantics of applying S2 only to the same Classifier
    and with the semantics of applying S1 and S2 to the same Classifier.

    3d) S2 specializes S1 and defines its own extensions(s) but does not
    specializes any of S1's extensions.

    For example, suppose S1 extends Classifier, then S1 has a property:
    S1::base_Classifier.
    Then, if S2 extends Classifier without specializing S1's extension, then
    there are two distinct properties: S1::base_Classifier and
    S2::base_Classifier
    This should be ill-formed; there should be an explicit specialization of
    the extension and redefinitions of both sides as in (3c).

  • Reported: UML 2.5b1 — Fri, 10 May 2013 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT