OOPortal OOPortal


Mapping Clients  «Prev 

Corba Interface Inheritance

We start with the IDL with interface inheritance and generated Java interfaces for the child.

The operations interface for the child inherits from the operations interface for the parent.

The signature interface for the child inhertis from the signature interface for the parent

Interface Definition Language (IDL)

An IDL file defines the public application programming interface (API) that is exposed by objects in a server application. The type of a CORBA object is called an interface, which is similar in concept to a C++ class or a Java interface. IDL interfaces support multiple inheritance. An IDL interface may contain operations and attributes. Many people mistakingly assume that an attribute is similar in concept to an instance variable in C++ (a field in Java) and this is wrong. An attribute is simply syntactic sugar for a pair of get- and set-style operations. An attribute can be readonly, in which case it maps to just a get-style operation.

The parameters of an operation have a specified direction, which can be in (meaning that the parameter is passed from the client to the server), out (the parameter is passed from the server back to the client) or inout (the parameter is passed in both directions). Operations can also have a return value. An operation can raise (throw) an exception if something goes wrong. There are over 30 predefined exception types, called system exceptions, that all operations can throw, although in practice system exceptions are raised by the CORBA runtime system much more frequently than by application code. In addition to the pre-defined system exceptions, new exception types can be defined in an IDL file. These are called user-defined exceptions. A raises clause on the signature of an operation specifies the user-defined exceptions that it might throw.