The Interface Definition Language IDL

Interfaces need to be described in a common language [VD98]. This common language is referred to as Interface Definition Language (IDL) and is used to describe the interface of an object. IDL is an object-oriented declarative language for specifying server interfaces. It is not a programming language; it cannot be used to write code. As we know, interfaces define the operations that an implementation object should provide. As an example, Figure 11-1 shows the module definition for a hypothetical environmental model. Line 1 defines the module Environmental Model. Modules provide a name scope for identifiers in an IDL specification. This scope prevents name clashes for identifiers defined in other modules. As for example, within the module EnvironmentalModel, only one interface, referred to as IWeather can, be declared. Line 3 defines interface IWeather within the scope of module EnvironmentalModel. Lines 4 through 12 define methods for interface IWeather. Line 14 defines interface ISoil within the scope of module EnvironmentalModel, and line 15 defines the only method of interface ISoil. The interface definition of object IWeather shows that the object should provide weather data, such as solar radiation, average temperature, minimum temperature, maximum temperature, rainfall, etc. Any class that implements this interface would specify how these weather data would be obtained.

1 module EnvironmentalModel {

0 0

Post a comment