Issue 1513: Exception for creating instances of imported supertypes? (mof-rtf) Source: (, ) Nature: Revision Severity: Minor Summary: Summary: What exception should Reflective::RefObject::create_instance() raise if it is unable to create an instance of a supertype where the supertype is imported from another Package? Resolution: resolved and closed Revised Text: Actions taken: June 9, 1998: received issue May 8, 2000: closed issue Discussion: Discussion: This issue highlights an anomaly in the mapped IDL when a Class is defined as a subtype of an imported Class. The M1 level interfaces for the subtype Class inherit a factory operation for the supertype Class that can't be implemented for an independent Package instance. Possible solutions: 1. Remove the create anomoly by forbidding generalization of imported Classes. Problem: this is too important / useful a meta-modelling capability to lose. 2. Restructure the mapped IDL so that the anomalous operation is not inheritted. For example, move the classes factory operation into the Package interface for the en-closing Package. [If we move the IDL operations for classifier-level Attributes and Operations into the Class instance interface, we can get rid to the the Class proxy interface entirely!] Problem: this change has substantial impact on current MOF implementations. 3. Define that the anomalous inheritted factory always returns nil or raises an excep-tion. Problem: we don't need to go this far. In particular, if the imported Class and the subtype Class are within the same extent, the create operation is implementable. 4. Define the behaviour of the inheritted factory operation to be valid when the Pack-age extent includes proxies for both subtype and supertype Classes, and to raise an exception othewise. Proposed resolutions: 1. Add an extent-based restriction on creation of instances with an imported super-type. Applies to instances of both the Class and its imported supertype Class. 2. Raise a new kind of structural ConstraintError when the above rule is violated. Implementation: The supertype closure rule is defined in “The Supertype Closure Rule” on page 5-22, and there is a new error kind "Supertype Clo-sure"; see Section 5.4.2, “Structural Errors,” on page 5-26. The specific and reflective versions of the create operation updated to track this. Done. [SC] End of Annotations:===== Return-Path: To: mof-rtf@omg.org, issues@omg.org Subject: Exception for creating instances of imported supertypes? Date: Tue, 09 Jun 1998 16:31:30 +1000 From: Stephen Crawley Source: DSTC (Dr. Stephen Crawley, crawley@dstc.edu.au) Nature: Revision Severity: Minor Summary: What exception should Reflective::RefObject::create_instance() raise if it is unable to create an instance of a supertype where the supertype is imported from another Package?