Skip to main content

Distributed object, IDL; RPC vs RMI

Short answer

A distributed object exposes methods callable from other processes via a remote interface and unique reference. IDL is a language-neutral interface specification from which stubs and skeletons are generated. RPC uses client/server stubs around a procedure; RMI uses proxy, remote reference module, dispatcher, skeleton, and registry around a remote object.

Define distributed object and IDL. Compare RPC and RMI architecture.

Distributed object

A distributed object is an object whose methods can be invoked by processes on other computers. Its state is encapsulated and is accessible only through methods defined in a remote interface, and each remote object has a unique remote object reference (network address, object id, interface) that can be passed as a parameter or result. Examples are Java RMI remote objects and CORBA objects.

IDL

An Interface Definition Language (IDL) is a language-neutral notation that specifies the operations (names, parameter and return types, exceptions) that a remote object or server offers, without implementation. An IDL compiler generates the client stub/proxy and server skeleton in the chosen programming language (CORBA IDL, Sun XDR/rpcgen, Java remote interface).

Example (CORBA IDL):

interface Account {
    void deposit(in float amount);
    float getBalance();
};

Comparison of RPC and RMI architecture

RPC architecture: client program calls client stub, which marshals and sends through the RPC runtime to the server stub, which calls the server procedure. Only stubs exist; binding is to a server (program/procedure number) through a port mapper.

RMI architecture: client object calls a proxy, a remote reference module maps references, and the communication module sends the request; at the server the dispatcher selects the skeleton, which calls the remote object. A registry binds names to remote object references.

PointRPCRMI
ParadigmProcedure orientedObject oriented
What is calledA remote procedure/functionA method of a remote object
ParametersOrdinary data, passed by value (structures)Objects too, passed by value (serialised) or by remote reference
Object identityNoneRemote object references identify objects
StateProcedures usually without object stateMethods work on the state of an object
LanguageUsually language independent (C, XDR)Java RMI is Java only; CORBA is language independent
InterfaceIDL such as Sun XDR/rpcgenJava interface or CORBA IDL
Garbage collectionNot applicableDistributed garbage collection of remote objects
Polymorphism, inheritanceNot supportedSupported
UseProcedural client-serverComplex distributed object applications

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 2 questions →