Issue 4413: IDL mapping Tag for specifying IDL #pragma versions (mof-rtf) Source: DSTC (Dr. Stephen Crawley, nobody) Nature: Revision Severity: Minor Summary: There is currently no standard way to direct the MOF IDL mapping to output a #pragma version for a declaration. This is needed when a standard meta-model is changed in a way that gives IDL interfaces, etc with the same name but different signatures. Resolution: see above Revised Text: Change the heading for section 5.6.1 from "5.6.1 Tags for Specifying IDL #pragma prefix" to "5.6.1 Tags for Specifying IDL #pragma directives" Add the following as section 5.6.1.2 "5.6.1.2 IDL Version When a MOF metamodel is modified it will often result in generated IDL that has the same module and interface names but different interface signatures. In such cases, it is strictly necessary to use different IDL version numbers for all types, interfaces and exceptions whose signatures have changed. In MOF 1.4, this can be done by attaching an Version tag to model elements. tag id: "org.omg.mof.idl_version" attaches to: Model::Package, Model::Class, Model::Association, Model::Attribute, Model::Operation, Model::Reference, Model::StructureType, Model::AliasType, Model::CollectionType, Model::EnumerationType, Model::Exception, Model::Constant, Model::Constraint values: one String idl generation: A #pragma version is inserted into the IDL for module, interface, data type, constant and exception declarations that are generated from the tagged model element. Version tags on Attributes, Operations and References result in version tags for the corresponding IDL operations. Refer to the respective templates for details. restrictions: [1] A Version tag value must have the form <major>.<minor> where <major> and <minor> are unsigned 16 bit decimal integers." [2] It is not meaningful to attach a Version tag to an AssociationEnd, Import, Parameter, Tag, StructureField or PrimitiveType. Add the following to 5.8.2, after "module <PackageName> {" // If this Package has an idl_version Tag #pragma version <PackageName> <<version>> Add the following to 5.8.3, after "interface <PackageName>PackageFactory {" // If this Package has an idl_version Tag #pragma version <PackageName>PackageFactory <<version>> Add the following to 5.8.4, after "... {" // If this Package has an idl_version Tag #pragma version <PackageName>Package <<version>> Add the following to 5.8.5, after the respective typedefs // If this Class has an idl_version Tag #pragma version <ClassName>Bag <<version>> // If this Class has an idl_version Tag #pragma version <ClassName>Set <<version>> // If this Class has an idl_version Tag #pragma version <ClassName>List <<version>> // If this Class has an idl_version Tag #pragma version <ClassName>UList <<version>> Add the following to 5.8.7, after "... {" // If this Class has an idl_version Tag #pragma version <ClassName>Class <<version>> Add the following to 5.8.8, after "... {" // If this Class has an idl_version Tag #pragma version <ClassName> <<version>> In 5.8.10: after the <AssociationName>Link struct declaration add: // If this Association has an idl_version Tag #pragma version <AssociationName>Link <<version>> after the <AssociationName>LinkSet typedef declaration add: // If this Association has an idl_version Tag #pragma version <AssociationName>LinkSet <<version>> after "... {" add: // If this Association has an idl_version Tag #pragma version <AssociationName> <<version>> In 5.10.11: after every Attribute operation <name>, add // If this Attribute has an idl_version Tag #pragma version <name> <<version>> In 5.10.12: after every Reference operation <name>, add // If this Reference has an idl_version Tag #pragma version <name> <<version>> In 5.10.13: after the Operation's <operation_name> declaration, add // If this Operation has an idl_version Tag #pragma version <operation_name> <<version>> In 5.10.14: after the Exception's <ExceptionName> declaration, add // If this Exception has an idl_version Tag #pragma version <ExceptionName> <<version>> In 5.10.15: after the 'const' declaration, add // If this Constant has an idl_version Tag #pragma version <CONSTANT_NAME> <<version>> In 5.10.16: after the 4 alternative declarations of <datatype_name>, add // If this DataType has an idl_version Tag #pragma version <datatype_name> <<version>> after the 4 collection typedefs, add (respectively) // If this DataType has an idl_version Tag #pragma version <datatype_name>Bag <<version>> // If this DataType has an idl_version Tag #pragma version <datatype_name>Set <<version>> // If this DataType has an idl_version Tag #pragma version <datatype_name>List <<version>> // If this DataType has an idl_version Tag #pragma version <datatype_name>UList <<version>> In 5.10.17: after the 'const' declaration, add // If this Constraint has an idl_version Tag #pragma version <CONSTRAINT_NAME> <<version>> Actions taken: July 21, 2001: received issue December 3, 2001: closed issue Discussion: An IDL specific Tag is the most appropriate way to deal with this. A resolution is urgently required because the IDL generated from the MOF 1.4 version of the Model requires #pragma version directives to indicate incompatible API changes. Add a new tag type for the IDL mapping that causes #pragma version directives to be output for selected IDL declarations correspond to a tagged model element. End of Annotations:===== X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: issues@omg.org cc: mof-rtf@omg.org Subject: IDL mapping Tag for specifying IDL #pragma versions Mime-Version: 1.0 Date: Sat, 21 Jul 2001 23:28:16 +1000 From: Stephen Crawley X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/) Content-Type: text/plain; charset=us-ascii X-UIDL: jiS!!lB+e92P@!!a,id9 Nature: Revision Severity: Minor Summary: There is currently no standard way to direct the MOF IDL mapping to output a #pragma version for a declaration. This is needed when a standard meta-model is changed in a way that gives IDL interfaces, etc with the same name but different signatures. Discussion: An IDL specific Tag is the most appropriate way to deal with this. A resolution is urgently required because the IDL generated from the MOF 1.4 version of the Model requires #pragma version directives to indicate incompatible API changes. X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: mof-rtf@omg.org Subject: Re: Issue 4138: IDL mapping Tag for specifying IDL #pragma versions Mime-Version: 1.0 Date: Fri, 27 Jul 2001 00:25:17 +1000 From: Stephen Crawley X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/) Content-Type: text/plain; charset=us-ascii X-UIDL: kc(!!/h)e92]d!!ld/!! I would appreciate some input on the resolution to this issue. Basically, it is easy to specify what an "idl_version" Tag looks like: Tag (tagId == "org.omg.mof.idl_version", values == [ "m.n" ] } but it is non-trivial deciding how it should be interpreted in the IDL mapping. For a start, it depends what element the Tag is attached to. First, I should note that in IDL, the "#pragma version XYZ m.n" sets the version for XYZ only ... not for IDL elements nested in XYZ. The "idl_version" Tag needs to behave the same way, otherwise we can't express version changes at the same level of granularity that IDL can. So here's my interpolation: * For an idl_version Tag on a Package, output a #pragma version for the module, the Package and the PackageFactory interfaces ... if any. * For an idl_version Tag on a Class, output a #pragma version for the Class and the interfaces. Also for the {Bag,Set,List,UList} typedefs. * For an idl_version Tag on an Association, output a #pragma version for the interface, the Link and the LinkSet types. * For an idl_version Tag on an Exception, Constant or Constraint output a #pragma version for the corresponding exception or constant declaration. * For an idl_version Tag on a DataType, output a #pragma version for the data type declaration and the {Bag,Set,List,UList} typedefs. The above are pretty much forced on us by the fact that when you change the version on a 'type' you are also supposed to change the version on an types whose declaration depends on it. [Michi Henning has spelled this all out me.] For features things start to get a bit hazy. The problem is that Attributes and References map to multiple IDL operations. And some operations in an Association interface are mappings of BOTH AssociationEnds. With the Tag defined as above (with one value), we might do this: * For an idl_version Tag on an Attribute, Reference or Operation, output a #pragma version for EVERY attribute or operation resulting from the element. * For an idl_version Tag on an AssociationEnd, no pragma is output. Or maybe ... AND/OR ... we could add allow an optional list of IDL names to be included in the Tag value; e.g. Tag { tagId = "idl_prefix", values = [ "x.y" , "" ... ] } OR ... maybe I should make the list of IDL names mandatory for all model elements, and only output #pragma version directives for those identifiers on the list? [I don't really like this idea, because it forces the meta-modeller to add lots of Tags where a few will usually suffice.] Any suggestions? -- Steve X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: mof-rtf@omg.org Subject: Re: issue 4413 - IDL mapping Tag for specifying IDL #pragma versions Mime-Version: 1.0 Date: Wed, 08 Aug 2001 15:44:10 +1000 From: Stephen Crawley X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/) Content-Type: text/plain; charset=us-ascii X-UIDL: @;!!!A(\!!IQ6e9lPE!! This issue needs to be resolved in the MOF 1.4 RTF cycle because we need to generate #pragma version directives into the MOF Model IDL. Please email your comments, ASAP. > Title: IDL mapping Tag for specifying IDL #pragma versions > Summary: > There is currently no standard way to direct the MOF IDL mapping to > output a #pragma version for a declaration. This is needed when a > standard meta-model is changed in a way that gives IDL interfaces, > etc > with the same name but different signatures. Proposed Resolution: Add a new tag type for the IDL mapping that causes #pragma version directives to be output for selected IDL declarations correspond to a tagged model element. Resolution Text: Change the heading for section 5.6.1 from "5.6.1 Tags for Specifying IDL #pragma prefix" to "5.6.1 Tags for Specifying IDL #pragma directives" Add the following as section 5.6.1.2 "5.6.1.2 IDL Version When a MOF metamodel is modified it will often result in generated IDL that has the same module and interface names but different interface signatures. In such cases, it is strictly necessary to use different IDL version numbers for all types, interfaces and exceptions whose signatures have changed. In MOF 1.4, this can be done by attaching an Version tag to model elements. tag id: "org.omg.mof.idl_version" attaches to: Model::Package, Model::Class, Model::Association, Model::Attribute, Model::Operation, Model::Reference, Model::StructureType, Model::AliasType, Model::CollectionType, Model::EnumerationType, Model::Exception, Model::Constant, Model::Constraint values: one String idl generation: A #pragma version is inserted into the IDL for module, interface, data type, constant and exception declarations that are generated from the tagged model element. Version tags on Attributes, Operations and References result in version tags for the corresponding IDL operations. Refer to the respective templates for details. restrictions: [1] A Version tag value must have the form . where and are unsigned 16 bit decimal integers." [2] It is not meaningful to attach a Version tag to an AssociationEnd, Import, Parameter, Tag, StructureField or PrimitiveType. Add the following to 5.8.2, after "module {" // If this Package has an idl_version Tag #pragma version <> Add the following to 5.8.3, after "interface PackageFactory {" // If this Package has an idl_version Tag #pragma version PackageFactory <> Add the following to 5.8.4, after "... {" // If this Package has an idl_version Tag #pragma version Package <> Add the following to 5.8.5, after the respective typedefs // If this Class has an idl_version Tag #pragma version Bag <> // If this Class has an idl_version Tag #pragma version Set <> // If this Class has an idl_version Tag #pragma version List <> // If this Class has an idl_version Tag #pragma version UList <> Add the following to 5.8.7, after "... {" // If this Class has an idl_version Tag #pragma version Class <> Add the following to 5.8.8, after "... {" // If this Class has an idl_version Tag #pragma version <> In 5.8.10: after the Link struct declaration add: // If this Association has an idl_version Tag #pragma version Link <> after the LinkSet typedef declaration add: // If this Association has an idl_version Tag #pragma version LinkSet <> after "... {" add: // If this Association has an idl_version Tag #pragma version <> In 5.10.11: after every Attribute operation , add // If this Attribute has an idl_version Tag #pragma version <> In 5.10.12: after every Reference operation , add // If this Reference has an idl_version Tag #pragma version <> In 5.10.13: after the Operation's declaration, add // If this Operation has an idl_version Tag #pragma version <> In 5.10.14: after the Exception's declaration, add // If this Exception has an idl_version Tag #pragma version <> In 5.10.15: after the 'const' declaration, add // If this Constant has an idl_version Tag #pragma version <> In 5.10.16: after the 4 alternative declarations of , add // If this DataType has an idl_version Tag #pragma version <> after the 4 collection typedefs, add (respectively) // If this DataType has an idl_version Tag #pragma version Bag <> // If this DataType has an idl_version Tag #pragma version Set <> // If this DataType has an idl_version Tag #pragma version List <> // If this DataType has an idl_version Tag #pragma version UList <> In 5.10.17: after the 'const' declaration, add // If this Constraint has an idl_version Tag #pragma version <>