Transcript poosd-G.ppt
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 {
interface world {
void hello();
void ask(in string x);
string tell();
oneway void halt();
};
};
universe.idl
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 {
Object next();
};
iterator
Language bindings
• types, references, access, ORB and BOA support
The Object interface
interface Object {
InterfaceDef get_interface();
Object duplicate();
...
}
PIDL