---
title: "Distributed object, IDL; RPC vs RMI"
subject: "Distributed System"
chapter: 2
key: "semester_7/distributed_system:object-idl-rpc-rmi"
source: https://www.bctengineer.com/q/semester_7/distributed_system/object-idl-rpc-rmi
site: BCT Engineering
---

# Distributed object, IDL; RPC vs RMI

Distributed System · Chapter 2: Distributed Objects and File System

- Asked in: 2074 Asoj, 3+5 marks
- Video: [Distributed Objects | Distributed System | Lec-42 | Bhanu Priya](https://www.youtube.com/watch?v=zbD12lQ4L-c) — Education 4u
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/object-idl-rpc-rmi
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-2

## Question

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

## 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.

## Answer

#### 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):
```text
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.

| 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 |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does an IDL specify?
   A. Operations (names, parameter and return types, exceptions) without implementation, in a language-neutral way
   B. The full implementation of the server
   C. The network routing tables
   D. Only the data stored in the object
   Answer: A. An IDL compiler generates the stub and skeleton from it. (Key point: IDL purpose)

2. What does an IDL compiler generate?
   A. The remote object's data
   B. Client stub/proxy and server skeleton in the chosen language
   C. The DNS records
   D. The registry itself
   Answer: B. That is why programmers do not write network code. (Key point: IDL compiler)

3. What does RPC architecture have, compared with RMI?
   A. Proxy, dispatcher and remote reference module
   B. A registry binding names to object references
   C. Only stubs, binding to a server (program/procedure number) through a port mapper
   D. Distributed garbage collection
   Answer: C. The latter items belong to RMI. (Key point: RPC architecture)

4. Which component selects the skeleton at the server in RMI?
   A. Dispatcher
   B. Registry
   C. Proxy
   D. Communication module
   Answer: A. The dispatcher selects the skeleton which calls the remote object. (Key point: RMI architecture)

## Related in Distributed System

- [Object communication; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobjects-communicate-rpc-rmi) — Distributed System, chapter 2
- [Compare RPC and RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Arpc-vs-rmi) — Distributed System, chapter 2, asked 2×
- [RPC vs RMI; modern RPC transparency](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Adifferentiate-rpc-modern-rpc) — Distributed System, chapter 2
- [IDL, middleware and RMI approach](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aidl-middleware-rmi) — Distributed System, chapter 2
- [Importance of IDL in RMI; static RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Armi-idl-static-rmi) — Distributed System, chapter 2
- [IDL and CORBA RMI with services](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aidl-corba-rmi) — Distributed System, chapter 4

## Related in other subjects

- [Client-server versus distributed object architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aclient-server-vs-distributed-object) — Software Engineering, chapter 3
- [Distributed object versus multiprocessor architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Adistributed-object-vs-multiprocessor) — Software Engineering, chapter 3
- [Compare procedural and object oriented programming](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aprocedural-vs-oop-compare) — Object Oriented Programming, chapter 1
- [Compare RISC and CISC architecture](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Arisc-vs-cisc) — Microprocessor, chapter 6, asked 4×
