Bionic Buffalo Tech Note #20: Quick Start Guide to Writing CORBA Client Applications
inadequate to represent a CORBA object, because, among other things, CORBA objects can be created
dynamically, and an application can use a reference to an object which does not yet exist; one cannot
do such a thing with Perl objects. Similarly, Perl objects are created at the server's run time and are
destroyed when the server process terminates, while CORBA objects may exist before the server is
started and may survive the destruction of the server.
For the C mapping, the IDL compiler generates code and data in C source code form, depending on the
compiler run time options selected. Such generated information includes:
For each IDL definition, a static repository definition constant is created.
For each IDL definition of a type for which a
TypeCode is defined, a TypeCode constant is
For each structure, union, sequence, and exception, an allocation functions function is created. For
each sequence, a buffer allocation function is created.
For each constant, a macro is defined for the constant's value.
enum value, a macro is defined as the numeric quantity associated with that value.
For each data type or interface, a suitable
typedef is generated
alias, the same or equivalent allocation functions, and macros are generated as for the
base type, except that the name is based on that of the
For each operation defined on an interface, a stub subroutine is generated. An application calling
the operation on an object calls the stub, which in turn creates a request which is mediated by the
ORB. The object reference is the first argument passed to the stub. The other arguments defined by
the IDL follow the object reference.
For each attribute defined on an interface, one or two stub routines are generated, similar to the stub
routines generated for operations. A stub for the
_get operation is generated, and, for attributes
which are not
readonly, a stub for the _set operation is also generated.
In addition to the above items useful to a client, various other items related to the server mapping
are created. The generated code relevant to servers only is not considered here.
The generated headers and programs are to be used by applications requiring access to, or use of, the
entities defined by the source IDL. In addition to necessary common libraries, the generated code is all
that is necessary to write CORBA compliant programs in the chosen programming language.
Design and Code the Application
A CORBA client application usually performs the following activities:
Page 5 of 11