PATH  WebObjects 4.0 Documentation > JavaClient Tutorial

Creating a Java Client WebObjects Application

Previous | Back Up One Level | Next

The Distribution Layer

The distribution layer (implemented by the EODistribution package on the client and the EOJavaClient framework on the server) is responsible for synchronizing the states of the object graphs on the client and on the application server in the middle tier. The distribution layer moves properties in both directions, that is, as it fetches objects and saves changes.

The distribution layer has a server side and a client side. The classes in the server side of this layer are provided by the EOJavaClient framework (and associated "wrapped" Java classes). The classes on the client side are implemented in Java and live in the com.apple.client.eodistribution package.


Client Distribution Classes

The client-side distribution layer has four public classes.

EODistributionChannel and EOHTTPChannel . The distribution layer provides channels through which the application server and the Java clients communicate. The EOHTTPChannel class implements an HTTP channel, which is used by Java Client WebObjects applications, but you can subclass the abstract class EODistributionChannel and implement a channel that uses a different transport protocol (such as CORBA). On the client side EODistributedObjectStore handles communication over the channel; on the server side it's EODistributionContext.

EODistributedObjectStore . On the client the distribution layer provides a distributed object store. It handles interaction with the distribution layer's channel (an EODistributionChannel object), incorporating knowledge of that channel so it can forward messages it receives from the server to its editing contexts and forward messages from its editing contexts to the server.

EODistributedDataSource . A concrete subclass of EODataSource (which is defined in EOControl) that fetches using an EOEditingContext as its source of objects; the editing context, in turn, forwards the fetch requests to its object store (usually an instance of EODistributedObjectStore) where it is ultimately serviced by an EODatabaseContext on the server.


Server Distribution Classes

The EOClientJava framework has four public classes.

EODistributionContext . This class encodes data to send to the client and decodes data it receives from the client over the distribution channel. It also keeps track of the state of the server-side object graph so it can communicate any changes to the client and thus synchronize the object graphs. EODistributionContext (or its delegate) also validate remote invocations originating from client objects.

WOJavaClientApplet . The WebObjects component is used to download and create an applet of class com.apple.client.interface.EOApplet.

EOClassMapper . Gives the corresponding class names on the client and server. The methods in this class are typically of interest to those who are implementing their own channels.

EOReferenceRecording . Use to encode and decode objects in a pure Java environment. The methods in this class are typically of interest to those who are implementing their own channels.

In addition, EOAccessAdditions.h contains Objective-C categories on EOEntity, EOClassDescriptions, and EOEntityClassDescription. The methods in these categories return client-specific information stored in model files.


© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next