Previous | Table of Contents | Next |
The IDL mapping may not produce valid CORBA IDL if any of the following preconditions on the input meta-model is not satisfied:
• The MOF Model constraints, as defined above, must all be satisfied for the input meta-model.
• The input meta-model must be structurally consistent.
• The visible names within a NameSpace must conform to the standard CORBA IDL identifier syntax:
“An identifier is an arbitrarily long sequence of ASCII alphabetic, digit and underscore (“_?) characters. The firstd character
must be an ASCII alphabetic character.?
Names of Model Elements that have a valid “idl_substitute_name? Tag are excepted from this precondition; (see 9.6.2.1,
“Substitute Name,? on page 196
).
NOTE: No such requirement applies to Model Elements such as Tags whose names are not visible in the IDL mapping. However,
for these “invisible? elements it is advisable to use a naming convention that minimizes the risk of name collision within
the Namespace itself.
• The visible ModelElement names must map to contextually unique IDL identifiers after name substitution (see 9.6.2.1, “Substitute Name,? on page 196 ), the application of the Format1, Format2 or Format3 name rewriting algorithms (see 9.7.1, “Generated IDL Identifiers,? on page 198) and other name mangling as specified in the mapping templates.
• An AliasType, CollectionType, or StructureType may not depend on itself via a chain of ‘IsOfType’ and ‘Contains’ links between DataType or StructureField instances. For example, MOF DataTypes that map to IDL recursive data types are not supported.
• A nested Package may not be used as a subtype or supertype.
• A nested Package may not import or be imported by another Package.
• After name substitution (see “Substitute Name? on page 196), the name of an Import must equal the name of its “importedNamespace.?
• A Class may not be nested within another Class.
• A Class may not be imported.
• If a Constraint is contained by a DataType or Operation, its name must also be unique in the DataType or Operation’s container Namespace.
• The following interim visibility definitions and constraints apply to the IDL mapping:
• A ModelElement is visible to another ModelElement only if the former has visibility of “public_vis.? • A ModelElement declared within another top-level Package is visible within a top-level Package only if the former Package is imported, clustered, or inherited by the latter Package. • One ModelElement can only depend on another (in the sense of the M2-level DependsOn Association) if the latter is visible from the former within the definition of visibility immediately above.
• Model Elements in a meta-model cannot be cyclically dependent except as follows:
• A dependency cycle consisting of one or more Classes is legal, provided they all have the same container. • A dependency cycle consisting of one or more Classes and one or more DataTypes or Exceptions, is legal provided they all have the same container.
NOTE: This precludes circular importing and circular clustering. It also precludes recursion between “pure? DataTypes. (The
two exceptions correspond to cases that can be expressed in OMG IDL using forward interface declarations.)
CORBA 2.3 adds an additional IDL restriction: “The name of an interface or a module may not be redefined within the immediate
scope of the interface of the module.? For example:
module M { typedef short M; // Error: M is the name of the module // in the scope of which the typedef is interface I { void
i (in short j); // Error: i clashes with the interface }; };
The IDL templates in this specification do not contain any patterns of this form. However, poor choice of names in a meta-model
may generate IDL that violates this restriction. In particular, the same name should not be used for both a container and
its contents. For example, a Package should not have the same name as one of its Classes, DataTypes, or Associations. A Class
should not have the same name as one of its Attributes or References. An Association should not have the same name as one
of its AssociationEnds.