---
title: "Importance of IDL in RMI; static RMI"
subject: "Distributed System"
chapter: 2
key: "semester_7/distributed_system:rmi-idl-static-rmi"
source: https://www.bctengineer.com/q/semester_7/distributed_system/rmi-idl-static-rmi
site: BCT Engineering
---

# Importance of IDL in RMI; static RMI

Distributed System · Chapter 2: Distributed Objects and File System

- Asked in: 2071 Shrawan, 3+5 marks
- Video: [Remote Method Invocation Explained in Hindi | RMI | Distributed System & Computing Lectures ✅](https://www.youtube.com/watch?v=XLJmx-BXo-A) — Last moment tuitions
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/rmi-idl-static-rmi
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-2

## Question

What is the importance of IDL in RMI? Write the operation of static RMI.

## Short answer

IDL defines a language-neutral contract, enabling stub/skeleton generation, type checking, and interoperability. In static RMI, stubs and skeletons are compiled; the server binds the object, the client looks it up and calls the stub, which marshals parameters and returns results via the skeleton.

## Answer

#### Importance of IDL in RMI
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).

- It is the **contract** between client and server. Client programmers only need the interface.
- The IDL compiler generates **stubs and skeletons**, so no network code is written by hand.
- It gives **language and platform independence** (in CORBA, a C++ client calls a Java object).
- It supports **type checking** of parameters and exceptions at compile time.
- It makes marshalling to a common format possible, and makes interfaces **publishable** for openness.
- In Java RMI the remote interface plays the same role.

#### Operation of static RMI
In **static (compile time) RMI** the stubs and skeletons are generated at compile time from the interface (by the IDL compiler or `rmic`) and linked into the client and server. The client knows the interface in advance. (Dynamic invocation, DII, builds requests at run time instead.)

```text
 1. Define IDL/remote interface
 2. Compile -> stub (client), skeleton (server)
 3. Write & start server: create object, register
 4. Client: look up -> proxy -> call method
```
1. The server creates the remote object and **binds** it to a name in the registry/naming service.
2. The client looks up the name and receives a **stub (proxy)**.
3. The client calls a method on the stub. The stub **marshals** the arguments and sends them.
4. The server's **skeleton** receives the request, unmarshals, and calls the method on the object.
5. The result is marshalled and returned, and the stub gives it to the client (or throws an exception).

Advantages: fast and type-safe. Disadvantage: the interface must be known at compile time and a change needs recompilation.

## Check yourself

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

1. Why is IDL important in RMI?
   A. It replaces the registry
   B. It is the language-neutral contract from which stubs and skeletons are generated, giving type checking
   C. It holds the implementation of remote methods
   D. It stores the objects' data
   Answer: B. IDL gives interface contract, automatic stub generation, language independence and compile-time type checking. (Key point: IDL contract)

2. What makes RMI 'static'?
   A. Stubs and skeletons are generated at compile time from the interface and linked in
   B. Requests are built at run time (DII)
   C. Objects cannot be looked up by name
   D. The server never changes its data
   Answer: A. Dynamic invocation (DII) builds requests at run time; static RMI knows the interface in advance. (Key point: Static RMI)

3. What does the server do first in static RMI operation?
   A. Recompiles the client
   B. Marshals the result
   C. Calls the client stub
   D. Creates the remote object and binds it to a name in the registry
   Answer: D. The server binds the object; the client then looks it up and receives a stub. (Key point: Binding step)

4. What is the main disadvantage of static RMI?
   A. It is slow and not type-safe
   B. It works only with dynamic binding
   C. The interface must be known at compile time and any change needs recompilation
   D. It cannot pass arguments
   Answer: C. Static RMI is fast and type-safe but inflexible to interface changes. (Key point: Disadvantage)

## Related in Distributed System

- [Distributed object, IDL; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobject-idl-rpc-rmi) — 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
- [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

- [Static channel assignment and CSMA/CD](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Astatic-channel-csmacd) — Computer Networks and Security, chapter 3
