23.4. ATM Case Study Implementation

This section contains the complete working implementation of the ATM system that we designed in Chapter 22 and this chapter. We consider the classes in the order in which we identified them in Section 22.4:

ATM

Screen

Keypad

CashDispenser

DepositSlot

Account

BankDatabase

Transaction

BalanceInquiry

Withdrawal

Deposit

We apply the guidelines discussed in Sections 23.2– and 23.3 to code these classes based on how we modeled them in the UML class diagrams of Figs. 23.10 and 23.11. To develop the definitions of classes’ member functions, we refer to the activity diagrams presented in Section 22.6 and the communication and sequence diagrams presented in Section 22.8. Note that our ATM design does not specify all the program logic and may not specify all the attributes and operations required to complete the ATM implementation. This is a normal part of the object-oriented design process. As we implement the system, we complete the program logic and add attributes and behaviors as necessary to construct the ATM system specified by the requirements specification in Section 22.3.

We conclude the discussion by presenting a C++ program (ATMCaseStudy.cpp) that starts the ATM and puts the other classes in the system in use. Recall that we’re developing a first version of the ATM system that runs on a personal computer and uses the computer’s keyboard and monitor to approximate the ATM’s keypad and screen. We also only simulate the actions of the ATM’s cash dispenser and deposit slot. We attempt to implement the system, however, so that real hardware versions of these devices could be integrated without significant changes in the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.1.156