Issue 2177: Add support for Exception generalization (mof-rtf) Source: (, ) Nature: Revision Severity: Significant Summary: Summary: UML currently supports Exception hierarchies, as do many object orient programming languages. MOF"s lack of support for this is perceived to be a limitation and an impediment to its use as a middleware independent meta-data framework. Resolution: Revised Text: Actions taken: November 6, 1998: received issue July 23, 1999: deferred to new RFP Discussion: We need to decide if this is within the scope of the MOF RTF. We can modify the MOF Model so that Exception inherits from GeneralizableElement. However, we should not to alter the Model - IDL mapping at this time. Instead, add a new precondition for IDL generation that Exceptions do not inherit. Exception hierarchies are not currently supported by CORBA IDL, and none of the cur-rently implementable alternatives for mapping to "flat" exceptions are appealing. Steve Vi-nowski has suggested a clever way to use OBV value types to simulate exception hierarchies in IDL, but this depends on OBV implementations being available. Status: Deferred to MOF 2.0 Implementation: Nothing to do. Done [KR] We can modify the MOF Model so that Exception inherits from GeneralizableElement. However, we should not to alter the Model - IDL mapping at this time. Instead, add a new precondition for IDL generation that Exceptions do not inherit. Exception hierarchies are not currently supported by CORBA IDL, and none of the currently implementable alternatives for mapping to "flat" exceptions are appealing. Steve Vinowski has suggested a clever way to use OBV value types to simulate exception hierarchies in IDL, but this depends on OBV implementations being available. End of Annotations:===== Return-Path: X-Exmh-Isig-CompType: unknown X-Exmh-Isig-Folder: inbox To: mof-rtf@omg.org, issues@omg.org cc: orb_revision@omg.org Subject: Add support for Exception generalization Date: Fri, 06 Nov 1998 14:35:41 +1000 From: Stephen Crawley ["new issue 8" from Seattle RTF doc.] Source: DSTC (Dr. Stephen Crawley, crawley@dstc.edu.au) Nature: Revision Severity: Significant Summary: UML currently supports Exception hierarchies, as do many object orient programming languages. MOF's lack of support for this is perceived to be a limitation and an impediment to its use as a middleware independent meta-data framework. Additional text: We can modify the MOF Model so that Exception inherits from GeneralizableElement in a way that is compatible with the UML metamodel. Since CORBA IDL does not support exception hierarchies, the best we can do is to map hierarchical exceptions back onto "flat" exceptions. Rather than do this, it is proposed that the IDL mapping would not support exception hierarchies at this time. A side purpose of this issue is to raise MOF / UML's "requirement" for a CORBA IDL extension to support exception hierarchies with the CORBA Core RTF. [I am fully aware of the reasons why CORBA IDL doesn't support this right now. Don't shoot me ... I'm just the messenger -- Steve C.] Return-Path: X-Sender: vinoski@mail.boston.iona.ie Date: Fri, 06 Nov 1998 00:24:06 -0500 To: Stephen Crawley From: Steve Vinoski Subject: Re: Add support for Exception generalization Cc: mof-rtf@omg.org, orb_revision@omg.org At 02:35 PM 11/6/98 +1000, Stephen Crawley wrote: >Since CORBA IDL does not support exception hierarchies, the best we >can do is to map hierarchical exceptions back onto "flat" exceptions. >Rather than do this, it is proposed that the IDL mapping would not >support exception hierarchies at this time. As much as I dislike the CORBA Objects by Value stuff, we might as well try to get something useful out of it given that we have to support it. Note, therefore, that you can use it as a not-too-ugly work-around for the lack of exception inheritance. For example: abstract valuetype MOF_ExceptionBase {}; exception MOF_Exception { MOF_ExceptionBase exc_data; }; You can simulate exception inheritance by deriving concrete valuetypes from MOF_ExceptionBase to represent derived exceptions. When you want to raise a particular exception, create an instance of the appropriate derived concrete valuetype, store it into the MOF_Exception exc_data member, and raise the MOF_Exception. The exception handler can then use valuetype narrowing or downcasting on the exc_data member, or in some languages can actually rethrow and catch the valuetype itself, to determine the intended exception type. You could also make MOF_ExceptionBase concrete and add a public string data member to it so that all MOF exceptions at least contained a string description of what went wrong. --steve Return-Path: To: Steve Vinoski cc: Stephen Crawley , mof-rtf@omg.org, orb_revision@omg.org Subject: Re: Add support for Exception generalization Date: Fri, 06 Nov 1998 15:43:02 +1000 From: Stephen Crawley Steve, That is a very useful suggestion! It may also help with another MOF issue (1085) which calls for rationalisation of the operation signature exceptions generated by the MOF Model -> IDL mapping. A bit of caution is needed though. If we follow this approach now, conformant implementations of the MOF spec cannot be built until CORBA 2.3 compliant ORBs are available. -- Steve