5 // This module has two interfaces. One represents a bank Account and
6 // the other is a factory to create the Account Objects.
11 // This interface represents an account with operations to check
12 // balance, deposit and withdraw.
17 // This exception is raised if the client tries to
18 // withdraw more money than the current balance.
23 readonly attribute
float balance
;
24 // Attribute to obtain the current <balance>.
26 void deposit
(in float amount
);
27 // Add <amount> to this account.
29 void withdraw
(in float amount
) raises
(Overdraft
);
30 // Withdraw <amount from this account.
32 attribute
string name
;
33 // The <name> of this account.
36 interface AccountManager
39 // This interface is a factory for the <Account> objects. It has
40 // operations to create <Account>s and to delete them.
42 Account open
(in string name
,
43 in float initial_balance
);
44 // Returns the <Account> associated with <name>. If this is the
45 // first time <name> has been seen, the server will create the
46 // account. Otherwise, the server will return back an object
47 // reference to a previously created account.
49 void close
(in Account account_
);
50 // Close down the account and release its resources if it's the
51 // last reference to the <account>. Once this call is made it
52 // is no longer valid to access the <account>.
55 // This operation shuts down the server.