IDLでは,別のインタフェースを継承するインタフェースを指定できます。IDLコンパイラによって生成されるクラスは,この継承関係を反映します。親インタフェースが宣言したすべてのメソッド,データ型定義,定数,および列挙体は,派生インタフェースからも参照できます。
interface parent {
void operation1();
};
interface child : parent {
. . .
long operation2(in short s);
};
コードサンプル11-15,11-16はIDLサンプル11-4に示すインタフェース定義から生成されたC++コードおよびJavaコードを示しています。
. . .
class parent : public virtual CORBA::Object {
. . .
void operation1();
. . .
};
class child : public virtual parent {
. . .
CORBA::Long operation2(CORBA::Short s);
. . .
};
public interface parentOperations {
public void operation1 ();
}
public interface childOperations extends parentOperations {
public int operation2 (short s);
}
public interface parent extends
com.inprise.vbroker.CORBA.Object, parentOperations,
org.omg.CORBA.portable.IDLEntity {
}
public interface child extends childOperations, Baz.parent,
org.omg.CORBA.portable.IDLEntity {
}