Issue 9171: Introduction and oclType() (ocl2-rtf) Source: SAP AG (Mr. Murray Spork, murray.spork@sap.com) Nature: Uncategorized Issue Severity: Summary: I only recently joined the OCL rtf at the request of David Frankel (who is now with SAP) - I have not seen any activity on this mailing list as yet so I hope this is an appropriate forum to raise this question. First let me introduce myself - I am lead for a proof-of-concept project investigating the use of OCL to express integrity constraints on models. Hopefully I will get a chance next year to attend a f2f meeting so that I can meet you all. On to my specific question: we have noticed that some time between OCL 1.1 and UML 1.4 "oclType", as a predefined feature, was removed. (I have been unable to find any versions of OCL between 1.1 and UML 1.4). I thought it would be best if we found out whether this removal was intentional before officially raising it as an issue. The reason is that we find a) this is a useful reflective feature to have and 2) it is still used in some current OMG specifications (note that it is used inconsistently). e.g.: - UML2 Infrastructure - (ptc/03-09-15) pg.89: Classifier::maySpecializeType(c : Classifier) : Boolean; maySpecializeType = self.oclIsKindOf(c.oclType) - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - pg.68 ExtentImpl::addObject(ObjectInstance o, String suppliedId [0..1]): String pre: not(self.entry.identifier includes suppliedId) post: oclIsNew(e) and oclType(e) = IdentifierEntry and e.object = o and self.entry includes e self.entry->select(ex | ex.identifier = e.identifier)->size() = 1 -- the new id is unique and (suppliedId <> null implies e.identifier = suppliedId) Resolution: Revised Text: Actions taken: November 13, 2005: received issue Discussion: End of Annotations:===== ubject: Introduction and oclType() Date: Mon, 14 Nov 2005 07:41:14 +0800 Thread-Topic: Introduction and oclType() Thread-Index: AcXoq7xubzDkEqYKRwyGxs1HYw/7WA== From: "Spork, Murray" To: X-OriginalArrivalTime: 13 Nov 2005 23:41:42.0492 (UTC) FILETIME=[CCEAD1C0:01C5E8AB] X-SAP: out X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id jADNbiPw010556 Hi all, I only recently joined the OCL rtf at the request of David Frankel (who is now with SAP) - I have not seen any activity on this mailing list as yet so I hope this is an appropriate forum to raise this question. First let me introduce myself - I am lead for a proof-of-concept project investigating the use of OCL to express integrity constraints on models. Hopefully I will get a chance next year to attend a f2f meeting so that I can meet you all. On to my specific question: we have noticed that some time between OCL 1.1 and UML 1.4 "oclType", as a predefined feature, was removed. (I have been unable to find any versions of OCL between 1.1 and UML 1.4). I thought it would be best if we found out whether this removal was intentional before officially raising it as an issue. The reason is that we find a) this is a useful reflective feature to have and 2) it is still used in some current OMG specifications (note that it is used inconsistently). e.g.: - UML2 Infrastructure - (ptc/03-09-15) pg.89: Classifier::maySpecializeType(c : Classifier) : Boolean; maySpecializeType = self.oclIsKindOf(c.oclType) - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - pg.68 ExtentImpl::addObject(ObjectInstance o, String suppliedId [0..1]): String pre: not(self.entry.identifier includes suppliedId) post: oclIsNew(e) and oclType(e) = IdentifierEntry and e.object = o and self.entry includes e self.entry->select(ex | ex.identifier = e.identifier)->size() = 1 -- the new id is unique and (suppliedId <> null implies e.identifier = suppliedId) Regards, -- Murray Spork Senior Researcher SAP Research Centre Brisbane SAP Australia Pty Ltd. 133 Mary St., Brisbane QLD 4000, Australia T +61 7 3259 9591 F +61 7 3259 9599 M +61 409 778 383 E murray.spork@sap.com http://www.sap.com/research Subject: RE: Introduction and oclType() Date: Mon, 14 Nov 2005 04:36:12 -0800 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Introduction and oclType() Thread-Index: AcXoq7xubzDkEqYKRwyGxs1HYw/7WAAa/0Kg From: "Karl Frank" To: "Spork, Murray" , X-OriginalArrivalTime: 14 Nov 2005 12:35:17.0664 (UTC) FILETIME=[DE840200:01C5E917] X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id jAECWjYE014132 would oclIsTypeOf() and oclIsKindOf() help you in this context? - Karl Frank -----Original Message----- From: Spork, Murray [mailto:murray.spork@sap.com] Sent: Sunday, November 13, 2005 3:41 PM To: ocl2-rtf@omg.org Subject: Introduction and oclType() Hi all, I only recently joined the OCL rtf at the request of David Frankel (who is now with SAP) - I have not seen any activity on this mailing list as yet so I hope this is an appropriate forum to raise this question. First let me introduce myself - I am lead for a proof-of-concept project investigating the use of OCL to express integrity constraints on models. Hopefully I will get a chance next year to attend a f2f meeting so that I can meet you all. On to my specific question: we have noticed that some time between OCL 1.1 and UML 1.4 "oclType", as a predefined feature, was removed. (I have been unable to find any versions of OCL between 1.1 and UML 1.4). I thought it would be best if we found out whether this removal was intentional before officially raising it as an issue. The reason is that we find a) this is a useful reflective feature to have and 2) it is still used in some current OMG specifications (note that it is used inconsistently). e.g.: - UML2 Infrastructure - (ptc/03-09-15) pg.89: Classifier::maySpecializeType(c : Classifier) : Boolean; maySpecializeType = self.oclIsKindOf(c.oclType) - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - pg.68 ExtentImpl::addObject(ObjectInstance o, String suppliedId [0..1]): String pre: not(self.entry.identifier includes suppliedId) post: oclIsNew(e) and oclType(e) = IdentifierEntry and e.object = o and self.entry includes e self.entry->select(ex | ex.identifier = e.identifier)->size() = 1 -- the new id is unique and (suppliedId <> null implies e.identifier = suppliedId) Regards, -- Murray Spork Senior Researcher SAP Research Centre Brisbane SAP Australia Pty Ltd. 133 Mary St., Brisbane QLD 4000, Australia T +61 7 3259 9591 F +61 7 3259 9599 M +61 409 778 383 E murray.spork@sap.com http://www.sap.com/research Subject: RE: Introduction and oclType() Date: Mon, 14 Nov 2005 21:15:10 +0800 Thread-Topic: Introduction and oclType() Thread-Index: AcXoq7xubzDkEqYKRwyGxs1HYw/7WAAa/0KgAADcKmA= From: "Spork, Murray" To: "Karl Frank" , X-OriginalArrivalTime: 14 Nov 2005 13:15:09.0661 (UTC) FILETIME=[7041C8D0:01C5E91D] X-SAP: out X-SAP: out X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id jAEDBV9T014484 Hi Frank, Thanks for the response. The problem is, with only oclIsTypeOf and oclIsKindOf at your disposal, you cannot query a model for some object, and then use the type of the result object from this query as a parameter to another operation - such as oclIsKindOf - or the equality operation such as in the example below. How else might I express a constraint such as [C-7] SupertypeKindMustBeSame in MOF 1.4?: context GeneralizableElement inv: self.supertypes -> forAll(s | s.oclType() = self.oclType()) Cheers, Murray > -----Original Message----- > From: Karl Frank [mailto:Karl.Frank@borland.com] > Sent: Monday, 14 November 2005 1:36 PM > To: Spork, Murray; ocl2-rtf@omg.org > Subject: RE: Introduction and oclType() > > would oclIsTypeOf() and oclIsKindOf() help you in this context? > > - Karl Frank > > -----Original Message----- > From: Spork, Murray [mailto:murray.spork@sap.com] > Sent: Sunday, November 13, 2005 3:41 PM > To: ocl2-rtf@omg.org > Subject: Introduction and oclType() > > > Hi all, > > I only recently joined the OCL rtf at the request of David > Frankel (who > is now with SAP) - I have not seen any activity on this > mailing list as > yet so I hope this is an appropriate forum to raise this question. > > First let me introduce myself - I am lead for a > proof-of-concept project > investigating the use of OCL to express integrity constraints > on models. > Hopefully I will get a chance next year to attend a f2f > meeting so that > I can meet you all. > > On to my specific question: we have noticed that some time between OCL > 1.1 and UML 1.4 "oclType", as a predefined feature, was > removed. (I have > been unable to find any versions of OCL between 1.1 and UML 1.4). > > I thought it would be best if we found out whether this removal was > intentional before officially raising it as an issue. The > reason is that > we find a) this is a useful reflective feature to have and 2) it is > still used in some current OMG specifications (note that it is used > inconsistently). > e.g.: > - UML2 Infrastructure - (ptc/03-09-15) pg.89: > Classifier::maySpecializeType(c : Classifier) : Boolean; > maySpecializeType = self.oclIsKindOf(c.oclType) > > - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - > pg.68 > ExtentImpl::addObject(ObjectInstance o, String suppliedId > [0..1]): String > pre: not(self.entry.identifier includes suppliedId) > post: oclIsNew(e) and oclType(e) = IdentifierEntry and > e.object = o and > self.entry includes e > self.entry->select(ex | ex.identifier = e.identifier)->size() = > 1 -- the new id is unique and > (suppliedId <> null implies e.identifier = suppliedId) > > Regards, > > -- > Murray Spork > Senior Researcher > SAP Research Centre Brisbane > SAP Australia Pty Ltd. > 133 Mary St., Brisbane QLD 4000, Australia > T +61 7 3259 9591 > F +61 7 3259 9599 > M +61 409 778 383 > E murray.spork@sap.com > http://www.sap.com/research > Subject: RE: Introduction and oclType() Date: Mon, 14 Nov 2005 16:11:31 +0100 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Introduction and oclType() Thread-Index: AcXoq7xubzDkEqYKRwyGxs1HYw/7WAAflwVA From: "BELAUNDE Mariano RD-MAPS-LAN" To: "Spork, Murray" , X-OriginalArrivalTime: 14 Nov 2005 15:11:32.0110 (UTC) FILETIME=[B21EF2E0:01C5E92D] X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id jAEF7qNo016331 Hi Murray, First of all, welcome to the OCL RTF. We didn't yet started our activity but we will start as soon as possible since we still have a lot of issues that could not be adressed during the FTF. Regarding the question you raise, I don't know what was the rationale for removing the generic 'oclType' feature when going from OCL1 to OCL2. Anyway, thanks to MOF2 reflection, the invariant "SupertypeKindMustBeSame" can now be re-written in the Following way: context GeneralizableElement inv: self.supertypes -> forAll(s | s.getMetaClass() = self.getMetaClass()) However effective availability of MOF reflection in OCL2 modules is currently an issue since the MOF Reflection is only an optional Package in MOF and hence in UML. Also the way how MOF reflective types relate to the type of the arguments of oclIsKindOf and oclIsTypeOf operations also need to be clarified. So I would suggest you raise the issue anyway. Yours, Mariano -----Message d'origine----- De : Spork, Murray [mailto:murray.spork@sap.com] Envoyé : lundi 14 novembre 2005 00:41 À : ocl2-rtf@omg.org Objet : Introduction and oclType() Hi all, I only recently joined the OCL rtf at the request of David Frankel (who is now with SAP) - I have not seen any activity on this mailing list as yet so I hope this is an appropriate forum to raise this question. First let me introduce myself - I am lead for a proof-of-concept project investigating the use of OCL to express integrity constraints on models. Hopefully I will get a chance next year to attend a f2f meeting so that I can meet you all. On to my specific question: we have noticed that some time between OCL 1.1 and UML 1.4 "oclType", as a predefined feature, was removed. (I have been unable to find any versions of OCL between 1.1 and UML 1.4). I thought it would be best if we found out whether this removal was intentional before officially raising it as an issue. The reason is that we find a) this is a useful reflective feature to have and 2) it is still used in some current OMG specifications (note that it is used inconsistently). e.g.: - UML2 Infrastructure - (ptc/03-09-15) pg.89: Classifier::maySpecializeType(c : Classifier) : Boolean; maySpecializeType = self.oclIsKindOf(c.oclType) - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - pg.68 ExtentImpl::addObject(ObjectInstance o, String suppliedId [0..1]): String pre: not(self.entry.identifier includes suppliedId) post: oclIsNew(e) and oclType(e) = IdentifierEntry and e.object = o and self.entry includes e self.entry->select(ex | ex.identifier = e.identifier)->size() = 1 -- the new id is unique and (suppliedId <> null implies e.identifier = suppliedId) Regards, -- Murray Spork Senior Researcher SAP Research Centre Brisbane SAP Australia Pty Ltd. 133 Mary St., Brisbane QLD 4000, Australia T +61 7 3259 9591 F +61 7 3259 9599 M +61 409 778 383 E murray.spork@sap.com http://www.sap.com/research Subject: RE: Introduction and oclType() Date: Mon, 14 Nov 2005 07:26:13 -0800 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Introduction and oclType() Thread-Index: AcXoq7xubzDkEqYKRwyGxs1HYw/7WAAflwVAAAEQ3NA= From: "Pete Rivett" To: "BELAUNDE Mariano RD-MAPS-LAN" , "Spork, Murray" , X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id jAEFLk3F016637 > Regarding the question you raise, I don't know what was the > rationale for removing the generic 'oclType' feature when > going from OCL1 to OCL2. I think the reason is bound up in resolution to issue 6531: this reflects a move away from treating OCLtype as a sort-of enumeration. An alternative proposal, to treat it as a powertype is in issue 6532 which was deferred to the RTF. Though the approach you suggest also seems reasonable. > However effective availability of MOF reflection in OCL2 > modules is currently an issue since the MOF Reflection is > only an optional Package in MOF and hence in UML. Not quite: Reflection is mandatory in MOF (both EMOF and CMOF); however it's not mandatory for UML tools to support Reflection (compliance with UML does not require compliance with MOF). However I'm not sure this is an issue specific to oclType() since a number of other OCL capabilities in effect require reflection (though less explicitly): for example navigating a non-navigable property by using the opposite classname. Regards Pete > -----Original Message----- > From: BELAUNDE Mariano RD-MAPS-LAN > [mailto:mariano.belaunde@francetelecom.com] > Sent: Monday, November 14, 2005 3:12 PM > To: Spork, Murray; ocl2-rtf@omg.org > Subject: RE: Introduction and oclType() > > Hi Murray, > > First of all, welcome to the OCL RTF. We didn't yet started > our activity but we will start as soon as possible since we > still have a lot of issues that could not be adressed during > the FTF. > > Regarding the question you raise, I don't know what was the > rationale for removing the generic 'oclType' feature when > going from OCL1 to OCL2. > Anyway, thanks to MOF2 reflection, the invariant > "SupertypeKindMustBeSame" can now be re-written in the > Following way: > > context GeneralizableElement > inv: self.supertypes > -> forAll(s | s.getMetaClass() = self.getMetaClass()) > > However effective availability of MOF reflection in OCL2 > modules is currently an issue since the MOF Reflection is > only an optional Package in MOF and hence in UML. > > Also the way how MOF reflective types relate to the type of > the arguments of oclIsKindOf and oclIsTypeOf operations also > need to be clarified. So I would suggest you raise the issue > anyway. > > Yours, > Mariano > > -----Message d'origine----- > De : Spork, Murray [mailto:murray.spork@sap.com] > Envoyé : lundi 14 novembre 2005 00:41 > À : ocl2-rtf@omg.org > Objet : Introduction and oclType() > > > Hi all, > > I only recently joined the OCL rtf at the request of David > Frankel (who is now with SAP) - I have not seen any activity > on this mailing list as yet so I hope this is an appropriate > forum to raise this question. > > First let me introduce myself - I am lead for a > proof-of-concept project investigating the use of OCL to > express integrity constraints on models. > Hopefully I will get a chance next year to attend a f2f > meeting so that I can meet you all. > > On to my specific question: we have noticed that some time between OCL > 1.1 and UML 1.4 "oclType", as a predefined feature, was > removed. (I have been unable to find any versions of OCL > between 1.1 and UML 1.4). > > I thought it would be best if we found out whether this > removal was intentional before officially raising it as an > issue. The reason is that we find a) this is a useful > reflective feature to have and 2) it is still used in some > current OMG specifications (note that it is used inconsistently). > e.g.: > - UML2 Infrastructure - (ptc/03-09-15) pg.89: > Classifier::maySpecializeType(c : Classifier) : Boolean; > maySpecializeType = self.oclIsKindOf(c.oclType) > > - Meta Object Facility (MOF) 2.0 Core Specification (ptc/03-10-04) - > pg.68 > ExtentImpl::addObject(ObjectInstance o, String suppliedId > [0..1]): String > pre: not(self.entry.identifier includes suppliedId) > post: oclIsNew(e) and oclType(e) = IdentifierEntry and > e.object = o and > self.entry includes e > self.entry->select(ex | ex.identifier = e.identifier)->size() = > 1 -- the new id is unique and > (suppliedId <> null implies e.identifier = suppliedId) > > Regards, > > -- > Murray Spork > Senior Researcher > SAP Research Centre Brisbane > SAP Australia Pty Ltd. > 133 Mary St., Brisbane QLD 4000, Australia > T +61 7 3259 9591 > F +61 7 3259 9599 > M +61 409 778 383 > E murray.spork@sap.com > http://www.sap.com/research >