OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
The component name that you specify at the top of a sams file must consist of a three-
character (no more, no less) string. For the ‘‘Hello World’’ program, we will use the
component name hel:
# Part I of simple sams file ...
component hel
The hel string will be used to identify all the files and data structures that sams will
generate from the file.
The second part of the sams file contains some additional serviceability-specific
information about the message data structures that will be generated. (This information is
necessary if the sams file is intended for serviceability use because sams is also used to
generate message files for general, nonserviceability use.)
This part of the file specifies the names of the serviceability table and the serviceability
handle. It also contains a list of the component’s subcomponents. A subcomponent
consists of a distinct functional module of executing code. For example, most distributed
applications would have a basic server subcomponent, a reference monitor
subcomponent that would handle authorization decisions, and one or more
subcomponents that would contain the application’s particular functionality.
The serviceability interface finds a component’s messages in one or more subtables, each
one associated with a subcomponent. When the message is displayed or written, the
associated subcomponent name is written in a field of the message. This allows
messages to be distinguished during routing or other processing on the basis of the
subcomponent with which they are associated.
Following is what the second part of our simplified sample sams file looks like. We call
the serviceability table hel_svc_table, and we call the serviceability handle
hel_svc_handle. Although we have used the three-letter component code hel in these
names, we were under no obligation to do so; we could have named the table and the
handle anything we wanted. (We will need to know both of these names when we make
the call in the application to initialize the interface in preparation for displaying
messages.)
A component must have at least one subcomponent specified in its sams file.
Subcomponents are specified in this part simply by supplying their table index, their
name, and their descriptive id in a series of separate lines, one per subcomponent and
each one beginning with the sub-component keyword, between a set of start and end
keywords:
# Part II
serviceability table hel_svc_table handle hel_svc_handle
start
subcomponent hel_s_main "main" hel_i_svc_main
end
In our example,
hel_s_main is the table index name for the subcomponent. Serviceability
routines need this name in order to locate and print any of the
subcomponent’s messages.
4 4 Tandem Computers Incorporated 124245