Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is IDL?

Tags:

idl

What is meant by IDL? I have googled it, and found out it stands for Interface Definition Language, which is used for interface definition for components. But, in practice, what is the purpose of IDL? Does Microsoft use it?

like image 531
g.revolution Avatar asked Mar 22 '09 06:03

g.revolution


People also ask

What is the purpose of IDL?

[31.1] WHAT IS THE PURPOSE OF IDL? IDL stands for Interface Definition Language. Its purpose is to define the capabilities of a distributed service along with a common set of data types for interacting with those distributed services.

What is IDL in science?

IDL (Interactive Data Language) software is the trusted scientific programming language used across disciplines to create meaningful visualizations out of complex numerical data.

What is an IDL document?

A file that contains interface and type library definitions is called an IDL file, and has a . idl file name extension. The Interface Definition Language (IDL) is not a programming language, but a descriptive language to describe the interfaces being implemented by objects. IDL files are similar to C++ header files.

What is service IDL?

The goal of an IDL is to describe the interface for some service so that clients wanting to use the service will know what methods and properties, the interface, the service provides. IDL is normally used with binary interfaces and the IDL language file describes the data types used in the binary interface.


2 Answers

An interface definition language (IDL) is used to set up communications between clients and servers in remote procedure calls (RPC). There have been many variations of this such as Sun RPC, ONC RPC, DCE RPC and so on.

Basically, you use an IDL to specify the interface between client and server so that the RPC mechanism can create the code stubs required to call functions across the network.

RPC needs to create stub functions for the client and a server, using the IDL information. It's very similar to a function prototype in C but the end result is slightly different, such as in the following graphic:

+----------------+ | Client         | |  +----------+  |         +---------------+ |  |   main   |  |         | Server        | |  |----------|  |         |  +----------+ | |  | stub_cli |----(comms)--->| stub_svr | | |  +----------+  |         |  |----------| | +----------------+         |  | function | |                            |  +----------+ |                            +---------------+ 

In this example, instead of calling function in the same program, main calls a client stub function (with the same prototype as function) which is responsible for packaging up the information and getting it across the wire to another process, via the comms channel.

This can be the same machine or a different machine, it doesn't really matter - one of the advantages of RPC is to be able to move servers around at will.

In the server, there's a 'listener' process that will receive that information and pass it to the server. The server's stub receives the information, unpacks it and passes it to the real function.

The real function then does what it needs to and returns to the server stub which can package up the return information (both return code and any [out] or [in,out] variables) and pass it back to the client stub.

The client stub then unpacks that and passes it back to main.

The actual details may differ a little but that explanation should be good enough for a conceptual overview.

The actual IDL may look like:

[   uuid(f9f6be21-fd32-5577-8f2d-0800132bd567),     version(0),     endpoint("ncadg_ip_udp:[1234]", "dds:[19]") ] interface function_iface {     [idempotent] void function(         [in] int handle,         [out] int *status     ); } 

All that information at the top (for example, uuid or endpoint) is basically networking information used for connecting client and server. The "meat" of it is inside the interface section where the prototype is shown. This allows the IDL compiler to build the function client and server stub functions for compiling and linking with your client and server code to get RPC working.

Microsoft does use IDL (I think they have a MIDL compiler) for COM stuff. I've also used third party products with MS operating systems, both DCE and ONC RPC.

like image 165
paxdiablo Avatar answered Oct 02 '22 12:10

paxdiablo


There is also Interactive Data Language which I had a job using for scientific data analysis, but perhaps from the context it's clear to you that's not what this IDL stands for.

like image 34
Kai Avatar answered Oct 02 '22 14:10

Kai