Skip to main content

Distributed objects and communication

Short answer

Distributed objects encapsulate state and offer methods via a remote interface with unique references. Communication occurs through RMI using client-side proxy and server-side skeleton that marshal/unmarshal parameters, with at-most-once semantics; other forms include RPC, messaging, and publish-subscribe events.

Define distributed objects and explain communication between distributed objects.

Distributed objects

A distributed object is an object whose methods can be invoked by processes on other computers. Its state is encapsulated and is accessible only through methods defined in a remote interface, and each remote object has a unique remote object reference (network address, object id, interface) that can be passed as a parameter or result. Examples are Java RMI remote objects and CORBA objects.

Parts of the model: remote interface (set of remotely callable methods), remote object reference, proxy at the client, skeleton and dispatcher at the server, and remote reference module. Local calls are made as usual; invocations of remote objects use RMI.

Communication between distributed objects

Distributed objects communicate in these ways.

  1. Remote method invocation (RMI): a client holding a remote reference calls a method through a proxy; the skeleton/dispatcher at the server calls the object. Request-reply protocol with call semantics (at-most-once), as in Java RMI and CORBA.
  2. Remote procedure call (RPC): procedural communication through stubs, used with non-object servers.
  3. Message passing: direct send/receive messages (sockets, message queues).
  4. Event notification (publish-subscribe): an object of interest publishes events and subscribers get notification asynchronously (Jini distributed events, CORBA event service).
  5. Group (multicast) communication for replicated objects.
 Client obj -> Proxy -> Request ----> Skeleton -> Remote obj
            <-        <-  Reply  <----

Marshalling converts arguments and results to a common external form (CDR in CORBA, serialisation in Java).

Key issues: invocation semantics (maybe, at-least-once, at-most-once), failures (exceptions such as RemoteException), parameter passing (by value for serialisable objects, by reference for remote objects) and binding through a naming service/registry.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 2 questions →