[Enterprise Extensions only]

IDL interface declarations

The IDL specification for a class of objects must contain a declaration of the interface these objects will support.

IDL interfaces and types should be enclosed inside a module scope. IDL declared outside of a module scope takes up namespace in the global IDL namespace and risks having name collisions with names declared by other IDL developers. For more information, see IDL name scoping.

When objects are implemented using classes, the interface name is used as a class name as well. In addition to the interface name and its base interface names, an interface indicates new methods (operations), and any constants, type definitions, and exception structures that the interface exports.

An interface declaration has the following syntax:

interface  interface-name [: base-interface1, base-interface2, ...]  
{
   constant declarations
   type declarations
   exception declarations
   attribute declarations
   operation declarations
};

All of the declaration elements are optional, and their order is not usually significant. However you must bear in mind the following considerations:

The base-interface names specify the interfaces from which interface-name is derived. Parent-interface names are required only for the immediate base interfaces. Each base interface must have its own IDL specification (which must be #included in the IDL file). A base interface cannot be named more than one time in the interface statement header.

The following topics describe the declaration elements that can be specified within the body of an interface declaration: