Issue 18706: Clarification needed about the semantics of stereotype specialization and stereotype application (uml25-ftf) Source: NASA (Dr. Nicolas F. Rouquette, nicolas.f.rouquette(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: 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). Resolution: Revised Text: Actions taken: May 10, 2013: received issue Discussion: End of Annotations:===== m: "Rouquette, Nicolas F (313K)" To: "issues@omg.org" CC: "uml25-ftf@omg.org" Subject: Clarification needed about the semantics of stereotype specialization and stereotype application. Thread-Topic: Clarification needed about the semantics of stereotype specialization and stereotype application. Thread-Index: AQHOTZA+ZszoX++PIkGJimVEf2fLLg== Date: Fri, 10 May 2013 15:08:36 +0000 Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.5.121010 x-originating-ip: [128.149.137.114] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized X-Virus-Scanned: amavisd-new at omg.org X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id r4AF93Ss011031 X-Brightmail-Tracker: AAAAAA== X-Brightmail-Tracker: AAAAAA== 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). - Nicolas.