DISTRIBUTED SYSTEM
CHAPTER 10 : CASE STUDY
LAB WORK SOLUTION- DISTRIBUTED SYSTEM
DISTRIBUTED SYSTEM -BCA -ALL SLIDES
MCQ- DISTRIBUTED SYSTEM

      DISTRIBUTED SYSTEM NOTE IOE

 

DISTRIBUTED OBJECT COMMUNICATION

 

Communication between distributed objects is a critical aspect of distributed systems, ensuring that objects located on different machines can interact seamlessly. 

 

SOME METHODS FOR DISTRIBUTED OBJECT COMMUNICATION:

 

1. Remote Method Invocation (RMI)

RMI is a key mechanism for communication between distributed objects, allowing a program to invoke methods that are executed on a remote object as if they were local.

  • Java RMI:
    • Java RMI enables Java objects to communicate over a network.
    • A remote object implements a remote interface, which extends java.rmi.Remote.
    • Methods in the remote interface throw java.rmi.RemoteException.
    • The client obtains a reference to the remote object using a naming service (e.g., RMI registry).

2. Common Object Request Broker Architecture (CORBA)

CORBA is a language-independent architecture and infrastructure that allows objects to communicate across networks.

  • ORB (Object Request Broker):
    • An ORB handles the communication between clients and servers.
    • The client uses the ORB to locate the remote object, prepare a request, and send it to the server.
    • The server’s ORB receives the request, processes it, and sends the result back to the client.

3. Microsoft Distributed Component Object Model (DCOM)

DCOM is an extension of the Component Object Model (COM) that supports remote communication.

  • Proxy and Stub:
    • The client uses a proxy object that represents the remote object.
    • The server has a corresponding stub object that handles the actual method execution.
    • Communication between the proxy and stub is managed by DCOM infrastructure.

4. SOAP (Simple Object Access Protocol) and Web Services

SOAP is a protocol for exchanging structured information in web services, allowing objects to communicate over a network.

  • XML-based Messaging:
    • SOAP uses XML to encode messages.
    • Messages are typically sent over HTTP/HTTPS.
    • Web services expose methods that can be called by clients, often using WSDL (Web Services Description Language) for describing the services.

5. REST (Representational State Transfer)

REST is an architectural style for designing networked applications, often used with HTTP.

  • Resource-based Communication:
    • RESTful services expose resources, each identified by a URL.
    • Clients interact with resources using standard HTTP methods (GET, POST, PUT, DELETE).
    • RESTful communication is stateless, with each request containing all necessary information.

REMOTE METHOD INVOCATION

Distributed objects generally communicate with Remote Method Invocation (RMI). RMI has a message passing mechanism in which one object sends a message to another object in a remote machine or process to carry out some task and the results are sent back to the calling object.

RMI uses stub and skeleton objects for communication with the remote object.

 

Stub

A stub is a client-side proxy that represents the remote object. It acts as a local representative for the remote object, handling the communication with the remote server where the actual object resides.

Functions of the Stub:

  1. Marshal the Parameters: The stub packages (or marshals) the parameters of the method call into a format suitable for transmission over the network.
  2. Send the Request: It sends the marshalled request to the remote server where the remote object is located.
  3. Receive the Response: The stub waits for the response from the remote server.
  4. Unmarshal the Response: Once the response is received, the stub converts (or unmarshals) it back into a format understandable by the client.
  5. Return the Result: The stub returns the result of the method invocation to the client.

Skeleton

A skeleton is a server-side entity that was used in earlier versions of Java RMI (up to JDK 5.0). It acts as a dispatcher for incoming method calls on the server side, processing the requests from the stub.

Functions of the Skeleton:

  1. Receive the Request: The skeleton receives the marshalled request from the client stub.
  2. Unmarshal the Parameters: It unmarshals the parameters from the request.
  3. Invoke the Method: The skeleton invokes the appropriate method on the actual remote object implementation.
  4. Marshal the Result: It marshals the result of the method invocation into a format suitable for transmission back to the client.
  5. Send the Response: The skeleton sends the marshalled response back to the client stub.