This blog is about providing theory as well as simple executable codes of different programming languages such as java, C, C++, and web programming, etc. This blog will be helpful to the IT students to learn about programming.

Thursday, March 9, 2023

What are Stub and Skeleton in Distributed Application? Explain its function with block diagram.

 Stub and Skeleton are two important components of distributed applications. A distributed application is a software system that runs on multiple computers connected through a network. It allows users to access resources and services on different computers as if they were on a local computer.

In a distributed application, a client program on one computer sends a request to a server program on another computer. The server program processes the request and sends a response back to the client program. Stub and Skeleton help to facilitate this communication between the client and server programs.

A Stub is a client-side proxy that represents the remote object on the client machine. It acts as a gateway for the client to communicate with the server. When a client invokes a method on the Stub, it marshals the arguments and sends them to the server over the network. The Stub then waits for the server to send a response. When the response is received, the Stub unmarshals the data and returns it to the client.

A Skeleton is a server-side proxy that represents the remote object on the server machine. It receives requests from the client and passes them on to the actual remote object. When the remote object returns a result, the Skeleton marshals the data and sends it back to the client over the network.

Here's a block diagram that shows how Stub and Skeleton work together in a distributed application:



As you can see from the diagram, the Stub and Skeleton act as proxies for the remote object. The client program interacts with the Stub, which in turn interacts with the Skeleton on the server. The Skeleton then interacts with the actual remote object to perform the requested operation. When the operation is complete, the Skeleton sends the result back to the client through the Stub.

Overall, Stub and Skeleton are important components of distributed applications, as they help to facilitate communication between the client and server programs over a network. They allow users to access remote resources and services as if they were on a local computer, making distributed computing more efficient and scalable.

No comments:

Post a Comment

If you have any doubts, please let me know

Slider Widget