---
title: "IDL, middleware and RMI approach"
subject: "Distributed System"
chapter: 2
key: "semester_7/distributed_system:idl-middleware-rmi"
source: https://www.bctengineer.com/q/semester_7/distributed_system/idl-middleware-rmi
site: BCT Engineering
---

# IDL, middleware and RMI approach

Distributed System · Chapter 2: Distributed Objects and File System

- Asked in: 2072 Kartik, 4+6 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/idl-middleware-rmi
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-2

## Question

Mention the role of IDL and middleware in Distributed System. Explain the RMI approach in the distributed object based system.

## Short answer

IDL gives a language-neutral contract and generates stubs/skeletons; middleware hides heterogeneity and provides transparency and common services. In RMI, a server registers a remote object, a client looks it up and calls through a proxy, and proxy/skeleton marshal and dispatch the invocation, making remote calls appear local.

## Answer

#### Role of 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).

- Gives a language independent contract between client and server.
- Lets stubs and skeletons be generated automatically.
- Hides heterogeneity: different languages and platforms use the same interface.
- Allows interface checking, versioning and publishing in an interface repository.

#### Role of middleware
**Middleware** is a software layer between the application and the operating system/network of each node that hides heterogeneity and gives a uniform programming model (RPC, RMI, message queues, ORB, transactions). Examples: CORBA, Java RMI, DCOM, web services.

Its role:
- hides differences in hardware, OS, network and languages (heterogeneity), via IDL and standard data formats;
- provides distribution transparency (location, access, replication, failure);
- gives common services: naming, security, transactions, events, persistence;
- makes application development easy (programmers write application logic, not network code) and promotes openness and interoperability.

#### RMI approach in distributed object based systems
**Remote Method Invocation (RMI)** is the object-oriented extension of RPC. An object in one process invokes a method of an object in another process (possibly on another host) through a *remote object reference*. In Java, RMI is built into the language; CORBA does the same for many languages.

**Architecture**

```text
 Client                         Server
 +-------------+                +-------------+
 | Client obj  |                | Remote obj  |
 | Proxy (stub)|                | Skeleton    |
 | Remote ref  |<-- network --->| Dispatcher  |
 | module      |                | Remote ref  |
 | Comm module |                | Comm module |
 +-------------+                +-------------+
        ^        Remote reference module: translates local <-> remote refs
        +--- Object registry / naming service: look up by name
```

- **Proxy (stub):** local representative of the remote object; marshals arguments and sends the request.
- **Skeleton / dispatcher:** unmarshals the request, selects the method and calls the object, then marshals the reply.
- **Remote reference module:** converts between local and remote object references.
- **Communication module:** carries request-reply messages with a chosen invocation semantics.
- **Registry / binder:** the client finds the remote object by name.

**Approach:** the application is a set of objects on different machines. A server creates a remote object and registers it in the registry. The client looks it up, receives a proxy, and invokes methods as if the object were local. The proxy and skeleton marshal, send and dispatch the calls, so that the remote call appears as a local one (location and access transparency). Parameters of remote type are passed by reference, others by value (serialisation). Failures are reported as exceptions, and unused remote objects are collected by distributed garbage collection.

## Check yourself

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

1. What is the role of an IDL?
   A. It implements the remote operations
   B. It schedules processes among nodes
   C. A language-neutral specification of operations from which stubs and skeletons are generated
   D. It encrypts the network traffic
   Answer: C. IDL declares names, types and exceptions without implementation; a compiler generates stub and skeleton. (Key point: IDL role)

2. What is middleware?
   A. A user application on top of the network
   B. A software layer between application and OS/network that hides heterogeneity and gives a uniform model
   C. Hardware that links computers
   D. An operating system kernel for one machine only
   Answer: B. Middleware (CORBA, Java RMI, etc.) hides hardware/OS/language differences and provides distribution transparency. (Key point: Middleware role)

3. How does a client get to use a remote object in RMI?
   A. It looks the object up by name in the registry, receives a proxy and calls methods as if local
   B. It copies the whole server program to itself
   C. It sends raw sockets messages written by the programmer
   D. It guesses the server's memory address
   Answer: A. The server registers the object; the client looks it up, gets a proxy, and the proxy/skeleton marshal and dispatch the calls. (Key point: RMI approach)

4. How are parameters passed in RMI?
   A. Only primitive types are allowed
   B. All by reference
   C. All by value, including remote objects
   D. Remote-type parameters by reference, others by value through serialisation
   Answer: D. Remote objects are passed as references; other objects are serialised and passed by value. (Key point: Parameter passing in RMI)

## 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
- [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
- [True distributed system; middleware organisation](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Atrue-ds-middleware) — Distributed System, chapter 3
- [Middleware role; CORBA and services](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Amiddleware-corba-services) — Distributed System, chapter 4
- [Object communication; RPC vs RMI](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aobjects-communicate-rpc-rmi) — Distributed System, chapter 2

## Related in other subjects

- [Distributed object versus multiprocessor architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Adistributed-object-vs-multiprocessor) — Software Engineering, chapter 3
- [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
