The bank application also manages another sort of account called a checking account. While an ordinary account must maintain a positive balance, acheckingAccount may be overdrawn up to an agreed limit.
We use IDL's notion of interface inheritance to capture the intuition that a checking account is a special form of account:
// in module BankingDemo
interface checkingAccount : account {
readonly attribute long limit;
};
The declarationcheckingAccount : account specifies that the interfacecheckingAccount inherits all the operations and attributes declared in theaccount interface. The body of the definition states that acheckingAccount also supports the additionallimit attribute.
The fact thatcheckingAccount inherits some operations fromaccount does not imply that the methods implementing those operations need to be inherited too. We will exploit this flexibility to provide a specializeddebit method forcheckingAccounts.