OSF DCE Application Development Guide--Introduction and Style Guide

Binding
Figure 4-3. Methods of Binding Management
Explicit
Method
Automatic
Method
Pass binding
handle to stub as
first parameter of
Client
Stub
Client
Appl.
Code
remote procedure call
Key:
= Code responsible for managing a binding handle
Implicit
Method
Obtain binding
information and set
binding handle
Obtain binding
information and set
global binding handle
Binding handle
defined as
global variable
Binding information
binding handle set
obtained and
You can see from this figure that with the automatic method, binding management
belongs completely to the client-stub code generated by the DCE IDL compiler. The
implicit method provides the application developer with some control over binding
management without having to pass a binding handle as a call argument. With the
explicit method, the application developer is completely responsible for binding
management. The automatic method requires the server to store binding information in
server entries in a namespace; the implicit and explicit methods work with any source of
binding information.
A client can use a combination of methods, even for an individual interface or if it uses
more than one interface. for example, one interface might use the automatic method,
another interface could use the implicit method, and a third could use the explicit
method. In addition, some procedures for the interfaces that use automatic or implicit
methods could use the explicit method instead. The method(s) of binding management
for an interface is specified using the interface definition, the attribute configuration file
(ACF), or both. In the interface definition, the explicit method can be specified for the
whole interface, or for an operation by declaring a binding handle (using the IDL type
handle_t) as the first parameter of the operation declaration.
The automatic and implicit methods are interface-wide and therefore mutually exclusive;
that is, for a given interface, a client can use only one of these interface-wide methods.
A client that uses either the automatic or implicit method for an interface can also use
the explicit method for some or all of the remote procedure calls to that interface. If the
remote procedure call has a binding handle parameter, the explicit method takes
precedence over either the automatic or implicit methods of managing bindings.
Explicit and implicit binding both give the client application means to select and modify
the binding information used by calls. Explicit binding allows the client to specify
binding information per call. This method may be established either by declaring a
binding handle parameter as the first parameter for a call in the IDL, or by applying the
[explicit_binding] attribute in the associated ACF, either to the interface as a whole, or
124246 Tandem Computers Incorporated 4 11