- 2070 Asar · 4+4 marks
Object communication; RPC vs RMI
Short answer
Distributed objects communicate via RMI, RPC, message passing, publish-subscribe events, and group multicast. RPC is procedure-oriented and calls a remote function with ordinary data; RMI is object-oriented and calls a method on a remote object, supporting object references, state, distributed garbage collection, and polymorphism.
Explain the ways how distributed objects communicate with each other. Differentiate between RPC and RMI.
How distributed objects communicate
Distributed objects communicate in these ways.
- Remote method invocation (RMI): a client holding a remote reference calls a method through a proxy; the skeleton/dispatcher at the server calls the object. Request-reply protocol with call semantics (at-most-once), as in Java RMI and CORBA.
- Remote procedure call (RPC): procedural communication through stubs, used with non-object servers.
- Message passing: direct send/receive messages (sockets, message queues).
- Event notification (publish-subscribe): an object of interest publishes events and subscribers get notification asynchronously (Jini distributed events, CORBA event service).
- Group (multicast) communication for replicated objects.
Client obj -> Proxy -> Request ----> Skeleton -> Remote obj
<- <- Reply <----
Marshalling converts arguments and results to a common external form (CDR in CORBA, serialisation in Java).
RPC versus RMI
| Point | RPC | RMI |
|---|---|---|
| Paradigm | Procedure oriented | Object oriented |
| What is called | A remote procedure/function | A method of a remote object |
| Parameters | Ordinary data, passed by value (structures) | Objects too, passed by value (serialised) or by remote reference |
| Object identity | None | Remote object references identify objects |
| State | Procedures usually without object state | Methods work on the state of an object |
| Language | Usually language independent (C, XDR) | Java RMI is Java only; CORBA is language independent |
| Interface | IDL such as Sun XDR/rpcgen | Java interface or CORBA IDL |
| Garbage collection | Not applicable | Distributed garbage collection of remote objects |
| Polymorphism, inheritance | Not supported | Supported |
| Use | Procedural client-server | Complex distributed object applications |
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Distributed object, IDL; RPC vs RMI · Distributed System, chapter 2
- DFS; RMI communication between objects · Distributed System, chapter 2
- RPC vs RMI; modern RPC transparency · Distributed System, chapter 2
- Distributed objects and communication · Distributed System, chapter 2 · asked 2×
- Compare RPC and RMI · Distributed System, chapter 2 · asked 2×
- RPC and its communication semantics · Distributed System, chapter 2 · asked 3×