In the distributed computing environment, stub stands for a client side object participating in the distributed object communication and a skeleton stands for a server side object participating in distributed object communication.
Stub | Skeleton |
The stub acts as a gateway for client side objects and all outgoing requests to server side objects that are routed through it. The stub wraps client object functionality and by adding the network logic ensures the reliable communication channel between client and server. The stub can be written up manually or generated automatically depending on chosen communication protocol. | A skeleton acts as gateway for server side objects and all incoming clients requests are routed through it. The skeleton wraps server object functionality and exposes it to the clients, moreover by adding the network logic ensures the reliable communication channel between clients and server. Skeletons be written up manually or generated automatically depending on chosen communication protocol. |
The stub is responsible for:
1. initiating the communication towards the server skeleton 2. translating calls from the caller object 3. marshalling of the parameters 4. informing the skeleton that the call should be invoked 5. passing arguments to the skeleton over the network 6. unmarshalling of the response from the skeleton 7. informing the skeleton that the call is complete |
The Skeleton is responsible for:
1. translating incoming data from the stub to the correct up-calls to server objects 2. unmarshalling of the arguments from received data 3. passing arguments to server objects 4. marshalling of the returned values from server objects 5. passing values back to the client stub over the network |