// -*- C++ -*- // $Id$ module Bank { // = TITLE // This module has two interfaces. One represents a bank Account and // the other is a factory to create the Account Objects. interface Account { // = TITLE // This interface represents an account with operations to check // balance, deposit and withdraw. exception Overdraft { // = TITLE // This exception is raised if the client tries to // withdraw more money than the current balance. string reason; }; readonly attribute float balance; // Attribute to obtain the current . void deposit (in float amount); // Add to this account. void withdraw (in float amount) raises (Overdraft); // Withdraw of this account. }; interface AccountManager { // = TITLE // This interface is a factory for the objects. It has // operations to create s and to delete them. Account open (in string name, in float initial_balance); // Returns the associated with . If this is the // first time has been seen, the server will create the // account. Otherwise, the server will return back an object // reference to a previously created account. void close (in Account account); // Close down the account and release its resources if it's the // last reference to the . Once this call is made it // is no longer valid to access the . void shutdown (); // This operation shuts down the server. }; };