1 / 72

Distributed Objects

Distributed Objects. Message Passing Vs Distributed Objects. Message Passing. The message-passing paradigm is a natural model for distributed computing in the sense that it mimics interhuman communications. Message Passing.

zhen
Download Presentation

Distributed Objects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Objects Message Passing Vs Distributed Objects

  2. Message Passing • The message-passing paradigm is a natural model for distributed computing in the sense that it mimics interhuman communications.

  3. Message Passing • It is an appropriate paradigm for network services where processes interact with each other through the exchange of messages.

  4. Message Passing • The abstraction provided by this paradigm may not meet the needs of some complex network applications for the following reasons:

  5. Message Passing • Basic message passing requires that the participating processes be tightly coupled. • Throughout their interaction, the processes must be in direct communication with each other.

  6. Message Passing • If the communication is lost between the processes the collaboration fails. • Example: • Consider a session of the Echo protocol • If the communication between the client and the server is disrupted, the session cannot continue.

  7. Message Passing • The message-passing paradigm is data-oriented. • Each message contains data marshaled in a mutually agreed upon format, and each message is interpreted as a request or response according to the protocol.

  8. Message Passing • Example: Echo Protocol • The receiving of a message from a process p elicits in the Echo server this action: a message containing the same data is sent to p.

  9. Message Passing • The data orientation of the paradigm is appropriate for network services and simple network applications • It is inadequate for complex applications involving large mix of requests and responses.

  10. Distributed Object • The distributed object paradigm is a paradigm that provides abstractions beyond those of the message-passing model.

  11. Distributed Objects • The paradigm is based on objects that exists in a distributed system. • In Object-oriented programming objects are used to represent an entity that is significant to an application.

  12. Distributed Objects • Each Object encapsulates • State • Operations

  13. Distributed Objects • Example • Consider the objects of the DatagramMessage class as shown

  14. Import java.net.*; public class DatagramMessage { private String message; private InetAddress senderAddress; private int senderport; public void putVal(String message,InetAddress addr, int port) { this.message = message; this.senderAddress=addr; this.senderPort =port; } public String getMessage() { return this.message; } public InetAddress getAddress() { return this.senderAddress; } public int getPort() { return this.senderport; } }

  15. Distributed Objects • Each object instantiated from this class contains three state and three operations.

  16. Distributed Objects • Local objects are objects whose methods can only be invoked by a local process. • A process that runs on the same computer on which the object exists

  17. Distributed Objects • A distributed object is one whose methods can be invoked by a remote process • A process running on a computer connected via a network to the computer on which the object exists.

  18. Distributed Objects • In a distributed object paradigm, network resources are represented by distributed objects. • To request service from a network resources, a process invokes one of its operations or methods, passing data as parameters to the method.

  19. Distributed Objects • The method is executed on the remote host, and the response is sent back to the requesting process as a return value.

  20. Distributed Objects • Compared to the message-passing paradigm, the distributed objects paradigm is action-oriented. • The focus is on the invocation of the operations, while the data passed takes on a secondary role.

  21. Distributed Objects

  22. An Archetypal Distributed Object Architecture • Archetypal • Original Model

  23. ADOA The task of a distributed object system is • to minimize the programming differences between remote method invocations and local invocations, • Allowing remote methods to be invoked in an application using syntax similar to local method invocations.

  24. ADOA • In reality, there are differences because remote method invocations involve communication between independent process.

  25. ADOA • The issues such as data marshalling and event synchornization need to be addressed.

  26. An Archetypal Distributed Object System

  27. An Archetypal Distributed Object System Object Registry OBJECT CLIENT CLIENT PROXY RUN-TIME SUPPORT NETWORK SUPPORT OBJECT SERVER SERVER PROXY RUN-TIME SUPPORT NETWORK SUPPORT PHYSICAL DATA PATH LOGICAL DATA PATH

  28. ADOA • A distributed object is provided or exported by a process, here called object server • A distributed object is registered in the object registry

  29. ADOA • A distributed object is accessed by the client process using object client • The object client looks up the registry for a reference to the object. • This reference is used by the object client to make calls to the methods of remote object

  30. ADOA • Logically the object client makes a call directly to a remote method of object server. • Physically the client is handled by a software components called • Client proxy - Object on behalf of client • Run time support - data marshalling • Network support – data transmission

  31. Distributed Object Systems • The distributed object paradigm has been widely adopted in distributed applications, among the most well known of such toolkits are: • RMI • CORBA • DCOM • SOAP

  32. Remote Procedure Calls • Remote Method Invocation (RMI) has its origin in a paradigm called Remote Procedure Call. • Procedural Programming predates object-oriented programming.

  33. Remote Procedure Calls • Remote Procedure call model, a procedure call or a function call is made by one process to another, possibly residing in a remote system, with data passed as arguments.

  34. Remote method Invocation • Remote Method Invocation(RMI) is an object-oriented implementation of Remote Procedure Call model. • It is an API for java programs only.

  35. Remoted Method Invocation • An object server exports a remote object and registers it with a directory service. • The object provides remote methods, which can be invoked in client programs.

  36. Remote Method Invocation • A remote object is declared with a remote interface (in java). • The remote interface is implemented by the object server. • An object client accesses the object by invoking its methods.

  37. Java RMI Architecture • Client-Side Architecture • Stub Layer • Remote Reference Layer • Transport Layer • Server-Side Architecture • Skeleton Layer • Remote Reference Layer • Transport Layer

  38. Client Side Architecture • Stub Layer: A client process’s remote method invocation is directed to a proxy object, known as a stub.

  39. Client Side Architecture • Remote Reference Layer: Interprets and manages references made from clients to remote service objects and issues the IPC operations to next layer.

  40. Client Side Architecture • Transport Layer: It is TCP based and therefore connection-oriented. • This layer and the rest of the network architecture carry out the IPC.

  41. Server-Side Architecture • Skeleton Layer: It lies just below the application layer and serves to interact with the stub layer on the client side.

  42. Server-Side Architecture • Remote Reference Layer: This layer manages and transforms the remote reference originating from the client to local references that are understandable by skeleton layer.

  43. Server Side Architecture • Transport Layer: This layer is a connection oriented layer based on TCP in the TCP/IP suite.

  44. Object Registry • The RMI registry a simple directory service, is provided with the JSDK. • When active it runs on TCP port 1099 by default.

  45. RMI Architecture Object Registry OBJECT CLIENT STUB Remote reference Layer Transport Layer OBJECT SERVER SKELETON Remote reference Layer Transport Layer Physical path Logical path

  46. RMI Architecture • Logically, from the point of view the software developer, the remote method invocation issued in a client program interact directly with the remote objects in a server program

  47. RMI Architecture • Physically, the remote method invocation are transformed to calls to the stub and skeleton at runtime, resulting in data transmission across the network.

  48. RMI Stub and RMI Skeleton CLIENT STUB SKELETON REMOTE METHOD Remote method call Marshal reques Unmarshal request TIME Execute Remote Method Marshal reply Unmarshal reply Return value

  49. Example of RMI • Create a Remote Interface • Create a Remote Implementation of Interface • Create a Server to access instance of remote method(interface) • Create a Client to access a remote method

  50. RMI API • Remote Interface: • Normal java interface which extends Remote class for coping up with RMI Syntax.

More Related