Introduction to child objects

Child callers and child dispatchers provide a convenient way of defining remote procedure calls that act on collections or sets of objects that share a common protocol. You define a child dispatcher and implementation for each object type you want to handle. A parent caller issues requests and instantiates child callers; a parent dispatcher evaluates incoming requests and instantiates child dispatchers as necessary.

A font server provides a good example of where child objects can be useful. Different fonts might share a common protocol, but their individual behavior differs. Using child objects, you can design dispatchers and dispatcher implementation classes that are specific to each font type, with a parent dispatcher to manage them.

When a parent caller sends a request to a parent dispatcher, the parent dispatcher evaluates the request (determining the font type) and instantiates the appropriate child dispatcher. The parent dispatcher communicates a child ID back to the parent caller, which then instantiates a child caller. From this point on, the child caller and child dispatcher communicate directly to process requests and replies. The child dispatcher persists beyond the single request--ready to handle future calls for the font type it is designed to process.

This section describes how child objects work. For information on how to use child objects, see "Implementing a collection of child objects" on page 99.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker