90 likes | 206 Views
This document provides an in-depth overview of Interface Definition Language (IDL) as it applies to object-oriented software development. It covers key concepts such as interface construction, operations, exceptions handling, and the relationships between interfaces and inheritance. Detailed examples demonstrate how IDL can be implemented across various programming languages, including C, Smalltalk, C++, and Java. The document also explores types and values, demonstrating how to define and manipulate constructed types, such as structs, unions, and sequences.
E N D
Principles of Object-Oriented Software Development Interface Definition Language
Interface Definition Language Introduction Example Types and values Operations and exceptioons Interfaces and inheritance Language bindings
Interface Definition Language IDL • modules -- for clustering • interfaces -- correspond with objects • attributes -- may be readonly • operations -- best effort invocation • exceptions -- for handling failure Language bindings C, Smalltalk, C++, Java
Example module universe { universe.idl interface world { void hello(); void ask(in string x); string tell(); oneway void halt(); }; };
Types and values Basic Types integers, reals, booleans, enum, string, any Constructed Types struct, union, sequence, array, interface Object References interface + operations
Operations and exceptions Operations in, out, inout -- parameter attributes Exceptions exception out_of_range { long count; } interface writer { void position(in long pos) raises(out_of_range); }
Interfaces and inheritance Interfaces and inheritance no overriding, no overloading Multiple (interface) inheritance interface A { }; interface B { }; interface C : A { }; interface D : B, A { };
interface iterator { iterator Object next(); };
Language bindings • types, references, access, ORB and BOA support The Object interface interface Object { PIDL InterfaceDef get_interface(); Object duplicate(); ... }