Section J.1. ATM Case Study Implementation


J.1. ATM Case Study Implementation

This appendix contains the complete working implementation of the ATM system that we designed in the nine Software Engineering Case Study sections in Chapters 1, 39 and 11. The implementation comprises 597 lines of Visual Basic code. We consider the 11 classes in the order in which we identified them in Section 4.9 (with the exception of transaction, which was introduced in Chapter 11 as the base class of classes BalanceInquiry, Withdrawal and Deposit):

  • ATM

  • Screen

  • Keypad

  • CashDispenser

  • DepositSlot

  • Account

  • BankDatabase

  • TRansaction

  • BalanceInquiry

  • Withdrawal

  • Deposit

We apply the guidelines discussed in Section 9.14 and Section 11.8 to code these classes based on how we modeled them in the UML class diagrams of Fig. 11.19 and Fig. 11.20. To develop the bodies of class methods, we refer to the activity diagrams presented in Section 6.11 and the communication and sequence diagrams presented in Section 7.20. 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 document in Section 3.9.

We conclude the discussion by presenting a Visual Basic application (ATMCaseStudy in Section J.13) that creates an object of class ATM and starts it by calling its run method. Recall that we are developing a first version of the ATM system that runs on a personal computer and uses the keyboard and monitor to approximate the ATM's keypad and screen. Also, we 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 code changes.



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net