Issue 17160: how to instantiate associations between stereotypes (uml2-rtf) Source: Microsoft (Mr. Steve Cook, stcook(at)microsoft.com) Nature: Uncategorized Issue Severity: Summary: UML says: ” Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.” How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: <sysml:ValueType xmi:id="id1" base_DataType="id2" unit="id3"/> What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? Is such an association allowed to be a composition? If so what would be the deletion semantics? Also, would we really expect to see any elements of this form? <sysml: A_valueType_unit xmi:id="id4" valueType="id1" unit="id5"/>? The following sentence: “For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass” appears to imply that we would never see such an element, but I don’t know of any statement to confirm this Resolution: Revised Text: Actions taken: February 23, 2012: received issue Discussion: End of Annotations:===== m: Steve Cook To: "issues@omg.org" Subject: Issue: how to instantiate associations between stereotypes. UML says: . Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.. How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? Is such an association allowed to be a composition? If so what would be the deletion semantics? Also, would we really expect to see any elements of this form? ? The following sentence: .For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass. appears to imply that we would never see such an element, but I don.t know of any statement to confirm this. Thanks -- Steve Subject: RE: Issue: how to instantiate associations between stereotypes. From: "Pete Rivett" To: "Steve Cook" Cc: , Inline below. From: Steve Cook [mailto:Steve.Cook@microsoft.com] Sent: Thursday, February 23, 2012 6:12 AM To: issues@omg.org Cc: uml-spec-simplification@omg.org; uml2-rtf@omg.org Subject: Issue: how to instantiate associations between stereotypes. UML says: . Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.. How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? [PJR] The stereotype instance: since the property is typed by the Stereotype rather than by the UML metaclass Is such an association allowed to be a composition? If so what would be the deletion semantics? [PJR] I don.t see why not. Deleting the owning Stereotype instance would delete the owned stereotype instance; the UML model elements would not be effected. However deleting the UML model element to which the owning stereotype has been attached would also delete that stereotype and also, again the owned stereotype instance. Also, would we really expect to see any elements of this form? ? The following sentence: .For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass. appears to imply that we would never see such an element, but I don.t know of any statement to confirm this. [PJR] regardless of the text you quote, and more generally regardless of end ownership, XMI 2.4 allows serialization of associations as links in this way as an option. They would not appear in Canonical XMI. Thanks -- Steve From: Steve Cook To: Pete Rivett Subject: RE: Issue: how to instantiate associations between stereotypes. Pete Those answers make sense to me . with one caveat. What if the child of the composition was related to its metaclass by an .isRequired. extension? In such a case, deleting the stereotype will cause the model to become ill-formed. Hopefully you will be able to clarify these topics in the Packages clause of the 2.5 spec. Some new examples would help enormously. Thanks -- Steve From: Pete Rivett [mailto:pete.rivett@adaptive.com] Sent: 23 February 2012 14:58 To: Steve Cook Cc: uml-spec-simplification@omg.org; uml2-rtf@omg.org Subject: RE: Issue: how to instantiate associations between stereotypes. Inline below. From: Steve Cook [mailto:Steve.Cook@microsoft.com] Sent: Thursday, February 23, 2012 6:12 AM To: issues@omg.org Cc: uml-spec-simplification@omg.org; uml2-rtf@omg.org Subject: Issue: how to instantiate associations between stereotypes. UML says: . Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.. How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? [PJR] The stereotype instance: since the property is typed by the Stereotype rather than by the UML metaclass Is such an association allowed to be a composition? If so what would be the deletion semantics? [PJR] I don.t see why not. Deleting the owning Stereotype instance would delete the owned stereotype instance; the UML model elements would not be effected. However deleting the UML model element to which the owning stereotype has been attached would also delete that stereotype and also, again the owned stereotype instance. Also, would we really expect to see any elements of this form? ? The following sentence: .For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass. appears to imply that we would never see such an element, but I don.t know of any statement to confirm this. [PJR] regardless of the text you quote, and more generally regardless of end ownership, XMI 2.4 allows serialization of associations as links in this way as an option. They would not appear in Canonical XMI. Thanks -- Steve From: "Bock, Conrad" To: "uml2-rtf@omg.org" Subject: RE: Issue: how to instantiate associations between stereotypes, composition between stereotypes Steve, > Is such an association allowed to be a composition? No, stereotype instances are already owned by the metaclass instances they are applied to, see constraint [2] of ExtensionEnd. Conrad From: Steve Cook To: "Bock, Conrad" Subject: RE: Issue: how to instantiate associations between stereotypes, composition between stereotypes Good point. >From: Bock, Conrad [mailto:conrad.bock@nist.gov] >Sent: 23 February 2012 15:19 >To: uml2-rtf@omg.org; uml-spec-simplification@omg.org ...snip... >No, stereotype instances are already owned by the metaclass instances they are applied to, see constraint [2] of ExtensionEnd. > >Conrad From: Dave Hawkins To: Steve Cook Subject: Re: Issue: how to instantiate associations between stereotypes. On 23/02/12 15:08, Steve Cook wrote: Pete Those answers make sense to me ­ with one caveat. What if the child of the composition was related to its metaclass by an .isRequired. extension? In such a case, deleting the stereotype will cause the model to become ill-formed. Isn't that the same as deleting any stereotype that's required? Or deleting an object that is at the mandatory end of a link, such as the target or supplier of a dependency? Hopefully you will be able to clarify these topics in the Packages clause of the 2.5 spec. Some new examples would help ...snip... of associations as links in this way as an option. They would not appear in Canonical XMI./* Thanks -- Steve From: Steve Cook To: Juergen Boldt Subject: RE: Issue: how to instantiate associations between stereotypes. UML. I raised some SysML ones earlier: this one is UML. Thanks -- Steve From: Juergen Boldt [mailto:juergen@omg.org] Sent: 23 February 2012 15:35 To: Steve Cook Subject: Re: Issue: how to instantiate associations between stereotypes. UML issue, or SysML? At 09:11 AM 2/23/2012, you wrote: UML says: . Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.. How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? Is such an association allowed to be a composition? If so what would be the deletion semantics? Also, would we really expect to see any elements of this form? ? The following sentence: .For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass. appears to imply that we would never see such an element, but I don.t know of any statement to confirm this. Thanks -- Steve Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org From: Steve Cook To: Dave Hawkins Subject: RE: Issue: how to instantiate associations between stereotypes. Dave >Isn't that the same as deleting any stereotype that's required? Yes. Also see Conrad's point that the stereotype is already owned, which invalidates my question anyway. >Or deleting an object that is at the mandatory end of a link, such as the target or supplier of a dependency? Indeed. And maybe that means that UML ought to say something else about deletion behaviour. Any tool that left the Dependency in existence and ill-formed when its client or supplier was deleted would be user-hostile, to say the least, although I suppose it would be "compliant". -- Steve >From: Dave Hawkins [mailto:dave.hawkins@oracle.com] >Sent: 23 February 2012 15:33 >To: Steve Cook ...snip... >Company Reg. No. 1782505. >Reg. office: Oracle Parkway, Thames Valley Park, Reading RG6 1RA. From: Dave Hawkins To: Steve Cook Subject: Re: Issue: how to instantiate associations between stereotypes. On 23/02/12 15:45, Steve Cook wrote: Or deleting an object that is at the mandatory end of a link, such as the target or supplier of a dependency? ...snip... ... when its client or supplier was deleted would be user-hostile, to say the least, although I suppose it would be "compliant". As the dependency isn't necessarily visible to the tool, it's probably fairly easy for users to end up with an equivalent invalid model. So tools should probably have some mechanism to report the problem. It would be reasonable for the MOF specification to give some guidance. Dave -- Steve -----Original Message----- From: Dave Hawkins [mailto:dave.hawkins@oracle.com] Sent: 23 February 2012 15:33 ...snip... Company Reg. No. 1782505. Reg. office: Oracle Parkway, Thames Valley Park, Reading RG6 1RA. From: "Rouquette, Nicolas F (313K)" To: "Bock, Conrad" CC: "uml2-rtf@omg.org" , "uml-spec-simplification@omg.org" Subject: Re: Issue: how to instantiate associations between stereotypes, composition between stereotypes Thread-Topic: Issue: how to instantiate associations between stereotypes, composition between stereotypes Thread-Index: AczyK2lhd42mMOd+TZu0Ccat+CdmtgAD1fGwAACzS0AJFwQ3AA== Date: Mon, 9 Apr 2012 14:42:13 +0000 Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [128.149.137.113] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized See below. On Feb 23, 2012, at 7:19 AM, Bock, Conrad wrote: Steve, Is such an association allowed to be a composition? No, stereotype instances are already owned by the metaclass instances they are applied to, see constraint [2] of ExtensionEnd. Conrad, I think this is irrelevant to Steve's question. constraint [2] is about the ownership of the ExtensionEnd property by the Extension association. constraint [2] has nothing to do with who owns stereotype instances. From: Steve Cook [mailto:Steve.Cook@microsoft.com] Sent: Thursday, February 23, 2012 6:12 AM To: issues@omg.org Cc: uml-spec-simplification@omg.org; uml2-rtf@omg.org Subject: Issue: how to instantiate associations between stereotypes. UML says: . Stereotypes can participate in binary associations. The opposite class can be another stereotype, a non-stereotype class that is owned by a profile, or a metaclass of the reference metamodel.. How are instances of these stereotypes and associations to be serialized? For example, look at SysML1.3 in which the stereotype ValueType has an association named A_valueType_unit to the stereotype Unit. How is a SysML 1.3 model supposed to instantiate this? There will be an element representing the stereotype instance of this form: What should id3 be the identity of? Presumably the target stereotype instance? Or the model element to which the target stereotype instance is applied? [PJR] The stereotype instance: since the property is typed by the Stereotype rather than by the UML metaclass I agree with Pete; however, note that this serialization uses IDREFs -- that is, the references are *within* the same XMI document. If the stereotype instances were serialized in a separate document than the document where the extended metaclasses instances are serialized, then the base_DataType would have to be an HREF. Similarly, if the stereotype instances linked by an association were in different documents, then they would have to be referenced by HREFs, not IDREFs. The MOF/XMI spec provides several ways to construct HREFs. Most tools have used the XMI:ID-based form of HREF which is inherently brittle and causes many problems for XMI serialization. It would be good to show examples of XMI:UUID-based HREFs which would be more robust than XMI:ID-based HREFs. Is such an association allowed to be a composition? If so what would be the deletion semantics? [PJR] I don.t see why not. Deleting the owning Stereotype instance would delete the owned stereotype instance; the UML model elements would not be effected. However deleting the UML model element to which the owning stereotype has been attached would also delete that stereotype and also, again the owned stereotype instance. Also, would we really expect to see any elements of this form? ? The following sentence: .For these associations there must be a property owned by the Stereotype to navigate to the opposite class. Where the opposite class is not a stereotype, the opposite property must be owned by the Association itself rather than the other class/metaclass. appears to imply that we would never see such an element, but I don.t know of any statement to confirm this. [PJR] regardless of the text you quote, and more generally regardless of end ownership, XMI 2.4 allows serialization of associations as links in this way as an option. They would not appear in Canonical XMI. I disagree with Pete; we *must* serialize instances of the association as Steve showed because these instances of associations may be referenced. - Nicolas.