Issue 15249: Why OCL does not have "super" reference? (ocl2-rtf) Source: (Dr. Maged Elaasar, melaasar(at)gmail.com) Nature: Uncategorized Issue Severity: Summary: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Resolution: Revised Text: Actions taken: April 20, 2010: received issue Discussion: End of Annotations:===== ubject: Why OCL does not have "super" reference? To: uml2-rtf@omg.org Cc: ocl2-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Tue, 20 Apr 2010 12:56:29 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 04/20/2010 12:56:30 I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMFAAJ9zUvUnw4R/2dsb2JhbACBP5lsVXG9RYUPBA Date: Tue, 20 Apr 2010 18:10:02 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: Maged Elaasar CC: uml2-rtf@omg.org, ocl2-rtf@omg.org Subject: Re: Why OCL does not have "super" reference? X-Plusnet-Relay: 6b85bfaa4450beb5c2a89c7ddb4ea78f Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 Subject: Re: Why OCL does not have "super" reference? To: uml2-rtf@omg.org Cc: ocl2-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Tue, 20 Apr 2010 13:12:29 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 04/20/2010 13:12:31 and btw, I did not mean a a reference "to" super, I meant a keyword "super" that allows referencing redefined versions of operations. Maged Elaasar/Ottawa/IBM@IBMCA Maged Elaasar/Ottawa/IBM@IBMCA 04/20/2010 12:56 PM To uml2-rtf@omg.org cc ocl2-rtf@omg.org Subject Why OCL does not have "super" reference? I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged pic23464.gif Subject: Re: Why OCL does not have "super" reference? To: Ed Willink Cc: ocl2-rtf@omg.org, uml2-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Tue, 20 Apr 2010 13:18:18 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 04/20/2010 13:18:24 Thank you Ed. So is the intention of this new concrete syntax to support static resolution? So without the qualification, it would be dynamic, and with it, it would be static? If that's so, then it addresses the same requirement as "super" I guess (and I now understand based on your reply why it is not a keyword). Why not change the AS to match the CS? Ed Willink Ed Willink 04/20/2010 01:10 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc uml2-rtf@omg.org, ocl2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 pic23642.gif Sender: Adolfo Sanchez Barbudo Date: Tue, 20 Apr 2010 18:24:45 +0100 From: Adolfo Sáhez-Barbudo Herrera Organization: Open Canarias S.L. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; es-ES; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b2pre Thunderbird/3.0 To: Maged Elaasar CC: "ocl2-rtf@omg.org" Subject: Re: Why OCL does not have "super" reference? Maged, Ocl 2.2 introduced an alternative (more powerful, in my opinion) way to invoke any operation defined in a "super" classifier. You are allowed to specify the path of the classifier which owns the operation you want to call. See the rule I and J of the OperationCallExpCS. Section 9.3.29, Page 81 of the last OCL specification. Cheers, Adolfo. El 20/04/2010 17:56, Maged Elaasar escribióI hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged -- Adolfo Sáhez-Barbudo Herrera adolfosbh(at)opencanarias(dot)com C/Elí Ramos Gonzáz, 4, ofc. 304 38001 SANTA CRUZ DE TENERIFE Tel.: +34 922 240231 Subject: Re: Why OCL does not have "super" reference? To: Ed Willink Cc: ocl2-rtf@omg.org, uml2-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Tue, 20 Apr 2010 13:24:53 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 04/20/2010 13:24:54 Just to make sure I got it right: If I have operation A::foo() : X, and operation B::foo() : X where B is a subclass of A, I can write the body condition of B::foo() as follows: B:foo() : X body: result = self.A::foo() and isXXX effectively calling A's version of foo and adding another condition to it. Is that right? Ed Willink Ed Willink 04/20/2010 01:10 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc uml2-rtf@omg.org, ocl2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 pic12373.gif X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQFACuGzUtUXeby/2dsb2JhbACBP5llB1VxvQaFDwQ Date: Tue, 20 Apr 2010 18:48:30 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: Maged Elaasar CC: ocl2-rtf@omg.org, uml2-rtf@omg.org Subject: Re: Why OCL does not have "super" reference? X-Plusnet-Relay: 588e43e1e25a0fdfe9f1f17c89d63d8a Hi maged On 20/04/2010 18:18, Maged Elaasar wrote: So is the intention of this new concrete syntax to support static resolution? So without the qualification, it would be dynamic, and with it, it would be static? That is solely my conclusion from studying the lack of OCL and UML specification. UML seems to specify that overload resolution is a variation point, so it is for OCL to define how overloads are to be resolved while evaluating OCL expressions. I have not seen such a specification. Consideration of the consequences of Collection conforming to OclAny seem to make dynamic resolution necessary. If that's so, then it addresses the same requirement as "super" I guess (and I now understand based on your reply why it is not a keyword). It would of course be possible to introduce a super keyword and require A::super or B::super disambiguation for rare multiple inheritance problems. Raise an issue. Why not change the AS to match the CS? Something will probably need to change. I'm hoping to get back to my run-time meta-model prototype shortly. This solves a surprising number of problems, quite possibly including this one. Regards Ed Willink Ed Willink Ed Willink 04/20/2010 01:10 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc uml2-rtf@omg.org, ocl2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMFANuKzUtUXebz/2dsb2JhbACBP5lsVXG9A4JfFYIbBA Date: Tue, 20 Apr 2010 19:09:48 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: Juergen Boldt CC: Maged Elaasar Subject: Re: Why OCL does not have "super" reference? X-Plusnet-Relay: d0d0881d143391d9e9f1f3d7cab70f41 On 20/04/2010 18:57, Juergen Boldt wrote: issue? Yes. Might as well. We don't have to resolve it favourably after some further thought. Ed At 01:48 PM 4/20/2010, Ed Willink wrote: Hi maged On 20/04/2010 18:18, Maged Elaasar wrote: So is the intention of this new concrete syntax to support static resolution? So without the qualification, it would be dynamic, and with it, it would be static? That is solely my conclusion from studying the lack of OCL and UML specification. UML seems to specify that overload resolution is a variation point, so it is for OCL to define how overloads are to be resolved while evaluating OCL expressions. I have not seen such a specification. Consideration of the consequences of Collection conforming to OclAny seem to make dynamic resolution necessary. If that's so, then it addresses the same requirement as "super" I guess (and I now understand based on your reply why it is not a keyword). It would of course be possible to introduce a super keyword and require A::super or B::super disambiguation for rare multiple inheritance problems. Raise an issue. Why not change the AS to match the CS? Something will probably need to change. I'm hoping to get back to my run-time meta-model prototype shortly. This solves a surprising number of problems, quite possibly including this one. Regards Ed Willink Ed Willink Ed Willink 04/20/2010 01:10 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc uml2-rtf@omg.org , ocl2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 Juergen Boldt Director, Member Services Object Management Group 140 Kendrick St Building A Suite 300 Needham, MA 02494 USA tel: +1 781 444 0404 x 132 fax: +1 781 444 0320 email: juergen@omg.org www.omg.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 Subject: Re: Why OCL does not have "super" reference? To: Ed Willink Cc: ocl2-rtf@omg.org, uml2-rtf@omg.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 From: Maged Elaasar Date: Tue, 20 Apr 2010 14:10:57 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.0.1|February 07, 2008) at 04/20/2010 14:10:58 Ed, some more points: - In Java, you can only call the "closest" redefined operation. Would this new syntax in OCL give you the ability to specify "which" fo the redefined operations in the supertype hierarchy to invoke? In such case, it would allow more than Java would. - Also, In this case, "super" keyword would be a shortcut for the 1) closest (from among a stack of redefined ops) 2) unamiguous (defined only in one super chain) redefined operation, which is most common case. - Is this same syntax applicable also to redefined attributes? I know in UML semantics, redefinition of at least attributes is meant to "hide" (i.e. as if it never existed) the redefined properies. Would this new syntax, if applied to attributes, contradict this? Ed Willink Ed Willink 04/20/2010 01:48 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc ocl2-rtf@omg.org, uml2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi maged On 20/04/2010 18:18, Maged Elaasar wrote: So is the intention of this new concrete syntax to support static resolution? So without the qualification, it would be dynamic, and with it, it would be static? That is solely my conclusion from studying the lack of OCL and UML specification. UML seems to specify that overload resolution is a variation point, so it is for OCL to define how overloads are to be resolved while evaluating OCL expressions. I have not seen such a specification. Consideration of the consequences of Collection conforming to OclAny seem to make dynamic resolution necessary. If that's so, then it addresses the same requirement as "super" I guess (and I now understand based on your reply why it is not a keyword). It would of course be possible to introduce a super keyword and require A::super or B::super disambiguation for rare multiple inheritance problems. Raise an issue. Why not change the AS to match the CS? Something will probably need to change. I'm hoping to get back to my run-time meta-model prototype shortly. This solves a surprising number of problems, quite possibly including this one. Regards Ed Willink Ed Willink Ed Willink 04/20/2010 01:10 PM To Maged Elaasar/Ottawa/IBM@IBMCA cc uml2-rtf@omg.org, ocl2-rtf@omg.org Subject Re: Why OCL does not have "super" reference? Hi Maged OCL 2.2 added qualified path names for feature navigation so you can do self.SuperClass::featureName which forces static resolution. You cannot do just SuperClass::featureName since according to commentary in Section 7 this would lack clarity. However there is no AST qualifier to indicate whether SuperClass::featureName was qualified or not so it is not clear how an implementation with only an AST available can tell whether to do dynamic or static feature resolution. (Resolution pending on this.) Introduction of a super keyword would not work since OCL is not a single inheritance language. Regards Ed Willink On 20/04/2010 17:56, Maged Elaasar wrote: I hope someone can explain to me why OCL does not have a reference to "super" (similar to the existing reference to "self"). Wouldn't you want to sometimes call the redefined version of an operation from an OCL exrpression, similar to how you can do that in Java? >From my limited knowledge of ALF (the action language), I understand it supports the "super" reference, so this tells me there is no semantic restriction there? Maged No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2823 - Release Date: 04/20/10 13:45:00 pic15058.gif