Jump to content

Distributed object communication

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nbarth (talk | contribs) at 02:35, 14 February 2016 (Protocols using Stub/Skeleton Approach: clean up: RPC isn't a specific protocol, DCE isn't object-oriented). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In a distributed computing environment, distributed object communication realizes communication between distributed objects. The main role is allow objects to access data and invoke methods on remote objects (objects residing in non-local memory space). Invoking a method on a remote object is known as remote method invocation or remote invocation, and is the object-oriented programming analog of a remote procedure call.

Class stubs and skeletons

The widely used approach on how to implement the communication channel is realized by using stubs and skeletons. They are generated objects whose structure and behavior depends on chosen communication protocol, but in general provide additional functionality that ensures reliable communication over the network.

When a caller wants to perform remote call on the called object, it delegates requests to its stub which initiates communication with the remote skeleton. Consequently, the stub passes caller arguments over the network to the server skeleton. The skeleton then passes received data to the called object, waits for a response and returns the result to the client stub. Note, there is no direct communication between the caller and the called object.

In more details, the communication consists of several steps:

  1. caller calls a local procedure implemented by the stub
  2. stub marshalls call type and in the input arguments into a request message
  3. client stub sends the message over the network to the server and blocks the current execution thread
  4. server skeleton receives the request message from the network
  5. skeleton unpacks call type from the request message and looks up the procedure on the called object
  6. skeleton unmarshalls procedure arguments
  7. skeleton executes the procedure on the called object
  8. called object performs a computation and returns the result
  9. skeleton packs the output arguments into a response message
  10. skeleton sends the message over the network back to the client
  11. client stub receives the response message from the network
  12. stub unpacks output arguments from the message
  13. stub passes output arguments to the caller, releases execution thread and caller then continues in execution

The advantage of this architecture is that neither the caller nor the called object has to implement network related logic. This functionality, that ensures reliable communication channel over the network, has been moved to the stub and the skeleton layer.

Protocols using Stub/Skeleton Approach

References