Programming with the Interface Repository Objects
The SOM Interface Repository Framework provides an object-oriented programming
interface to the IDL information processed by the SOM Compiler. Unlike many
frameworks that require you to inherit their behavior in order to use it,
the Interface Repository Framework is useful in its own right as a set of
predefined objects that you can access to obtain information. Of course,
if you need to subclass a class to modify its behavior, you can certainly
do so; but typically this is not necessary.
The SOM Interface Repository contains the fully-analyzed (compiled) contents
of all information in an IDL source file. This information takes the the
form of persistent objects that can be accessed from a running program.
There are ten classes of objects in the Interface Repository that correspond
directly to the major elements in IDL source files; in addition, one instance
of another class exists outside of the IR itself, as follows:
Contained
All objects in the Interface Repository
are instances of classes derived from this class and exhibit the common
behavior defined in this interface.
Container
Some objects in the Interface Repository hold
(or contain) other objects. (For example, a module [ModuleDef] can
contain an interface [InterfaceDef].) All Interface Repository objects
that hold other objects are instances of classes derived from this class
and exhibit the common behavior defined by this class.
ModuleDef
An instance of this class exists for each module
defined in an IDL source file. ModuleDefs are Containers,
and they can hold ConstantDefs, TypeDefs, ExceptionDefs,
InterfaceDefs, and other ModuleDefs.
InterfaceDef
An instance of this class exists for each interface
named in an IDL source file. (One InterfaceDef corresponds to
one SOM class.) InterfaceDefs are Containers, and they can
hold ConstantDefs, TypeDefs, ExceptionDefs, AttributeDefs,
and OperationDefs.
AttributeDef
An
instance of this class exists for each attribute defined in an IDL
source file. AttributeDefs are found only inside of (contained by)
InterfaceDefs.
OperationDef
An
instance of this class exists for each operation (method, _set_method,
and _get_method) defined in an IDL source file. OperationDefs are
Containers that can hold ParameterDefs. OperationDefs
are found only inside of (contained by) InterfaceDefs.
ParameterDef
An instance of this class exists for each parameter
of each operation (method) defined in an IDL source file. ParameterDefs
are found only inside of (contained by) OperationDefs.
TypeDef
An instance of this class exists for each typedef,
struct, union, or enum defined in an IDL source file.
TypeDefs may be found inside of (contained by) any Interface Repository
Container except an OperationDef.
ConstantDef
An instance of this class exists for each constant
defined in an IDL source file. ConstantDefs may be found inside
(contained by) of any Interface Repository Container except an OperationDef.
ExceptionDef
An
instance of this class exists for each exception defined in an IDL
source file. ExceptionDefs may be found inside of (contained by)
any Interface Repository Container except an OperationDef.
Repository
One instance
of this class exists for the entire SOM Interface Repository, to hold IDL
elements that are global in scope. The instance of this class does not,
however, reside within the IR itself.
[Back: Placing 'private' information in the Interface Repository]
[Next: Methods introduced by Interface Repository classes]