OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
1.4.1 Generating the Interface UUID
Interfaces, like most other objects and entities in DCE, are identified by associating each
one with a 128-bit universal unique identifier (UUID). An interface’s UUID serves to
identify it far and wide throughout DCE. Every interface in a DCE application must
have a UUID assigned to it.
When you define a new interface, you must generate a UUID for it. Consequently, the
first step in developing an interface definition is to run the uuidgen utility to generate a
UUID for the interface.
Typically, you run the uuidgen command with the -i option when generating an interface
UUID. The command line has the following syntax:
uuidgen -i > your_interface_name.idl
where your_interface_name is the name you have given your interface, and .idl is the
suffix that all interface definitions use by convention. The uuidgen utility generates a
file named your_interface_name.idl, that contains a skeleton of an interface definition
and includes the newly generated UUID for the interface. See the for more information
about the contents of this skeleton file. Refer to the uuidgen(1rpc) reference page for a
complete description of uuidgen.
1.4.2 Writing the Interface Definition File
The .idl file is where the set of remote operations that constitute the interface are defined.
The .idl file defines and characterizes the interfaces to the server implementations of the
remote operations (which you write, in C source code, then compile and link to the stub
code output by the IDL compiler). Thus, an .idl file’s contents is like a set of network
prototypes for a set of operations. The IDL definitions in the interface definition file
determine not only how the operations ‘‘look’’ to client and server (that is, the
operations’ call signatures, parameter types, and so on), but also what the data looks like
when it is transmitted back and forth between clients and servers in a distributed
application.
An interface definition file consists of the following two basic components:
An interface header
An interface header contains an interface UUID, interface version numbers, and an
interface name. An interface name is an easy-to-read local name that is not
guaranteed to be unique; it is merely a convenience. It is helpful if the interface
name reflects the nature or purpose of the interface.
An interface body
An interface body declares any application-specific data types and constants, and
contains directives for including data types and constants from other interfaces. The
interface body also contains the operation declaration of each remote procedure to be
accessed through the interface. An operation declaration identifies the parameters of
1 10 Tandem Computers Incorporated 124246