IDL allows you to define interfaces that are derived from a base interface. For example, say there are different types of real estate: residential, commercial, and rental. Real estate is the base interface and the types of real estate are called derived interfaces.
Attributes and operations defined for the base interface are automatically inherited by derived interfaces. However, a derived interface can declare new elements (constants, types, attributes, exceptions, and operations).
A derived interface can redefine any inherited type, constant, or expression but this is not recommended. An interface can also be derived from more than one base interface.
For example, following is a definition of a base interface called Company:
//IDL interface Company { attribute float assets; readonly attribute string owner; void securities(in float amount, out float assets); void expenses(in float amount, out float rembalance); };
Following is the definition of a derived interface called Personnel. The Personnel interface is derived from Company and can be defined as follows:
//IDL interface Personnel : Company { readonly attribute paycheck; boolean payday( ); };