To identify operations, we examine the verb phrases listed for each class in Fig. 22.16. The “executes financial transactions” phrase associated with class
ATM implies that class
ATM instructs transactions to execute. Therefore, classes
Deposit each need an operation to provide this service to the ATM. We place this operation (which we’ve named
execute) in the third compartment of the three transaction classes in the updated class diagram of Fig. 22.17. During an ATM session, the
ATM object will invoke the
execute operation of each transaction object to tell it to execute.