ATM Problem Class Description Forms

  1. Class ATM - with component parts:
    1. Class CardReader
    2. Class Display
    3. Class Keyboard
    4. Class CashDispenser
    5. Class EnvelopeAcceptor
    6. Class ReceiptPrinter
    7. Class OperatorPanel
  2. Class Session
  3. Class Transaction - with subclasses:
    1. Class WithdrawlTransaction
    2. Class DepositTransaction
    3. Class TransferTransaction
    4. Class InquiryTransaction
  4. Class Bank

 

[ Intro ] [ Requirements ] [ Domain Objects ] [ Use Cases ] [ State Diagram ] [ Interaction Diagram ]
[ CRC Cards ] [ Class Diagram ] [ Class Desc. Forms ] [ Operation Desc. Forms ] [ Code ] [ Executable ]

Copyright © 1996, 1997, 1998 - Russell C. Bjork. Permission for non-commercial reproduction for educational use is hereby granted; all other rights are reserved.

 


Class ATM
Name ATM
Base class(es)
Purpose Manage the ATM and component parts
States running
stopped
Constructors ATM(number, location, bank)
Operations
Mutators startupOperation()
serviceCustomers(initialCash)
Accessors getPIN()
getMenuChoice(whatToChoose, numItems, items)
getAmountEntry()
checkIfCashAvailable(amount)
dispenseCash(amount)
acceptEnvelope()
issueReceipt(cardNumber, serialNumber, description, amount, balance, availableBalance)
reEnterPIN()
reportTransactionFailure(explanation)
ejectCard()
retainCard()
number()
Fields _number
_location
_bank
_state
_cardReader
_display
_keyboard
_cashDispenser
_envelopeAcceptor
_receiptPrinter
_operatorPanel

[ View C++ class declaration code ] [ View Java interface documentation ]


Class CardReader
Name CardReader
Base class(es)
Purpose Manage the magnetic stripe card reader
States card not inserted
card inserted but unreadable
card inserted and readable
Constructors CardReader()
Operations
Mutators ejectCard()
retainCard()
checkForCardInserted()
Accessors cardNumber()
Fields _status
_cardNumberRead

[ View C++ class declaration code ] [ View Java interface documentation ]


Class Display
Name Display
Base class(es)
Purpose Manage the video display unit
States Each screen that can be displayed constitutes a distinct state
Constructors Display()
Operations
Mutators requestCard()
requestPIN()
displayMenu(whatToChoose, numItems, items)
requestAmountEntry()
requestDepositEnvelope()
reportCardUnreadable()
reportTransactionFailure(explanation)
requestReEnterPIN()
reportCardRetained()
echoInput(echo)
clearDisplay()
Accessors
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]


Class Keyboard
Name Keyboard
Base class(es)
Purpose Manage the keys used for customer input
States
Constructors Keyboard()
Operations
Mutators readPIN(echoOn)
readMenuChoice(numItems)
readAmountEntry(echoOn)
Accessors
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]


Class CashDispenser
Name CashDispenser
Base class(es)
Purpose Manage the cash dispenser
States
Constructors CashDispenser()
Operations
Mutators setCash(initialCash)
dispenseCash(amount)
Accessors currentCash()
Fields _currentCash

[ View C++ class declaration code ] [ View Java interface documentation ]


Class EnvelopeAcceptor
Name EnvelopeAcceptor
Base class(es)
Purpose Manage the slot that accepts a deposit envelope from the customer
States
Constructors EnvelopeAcceptor()
Operations
Mutators acceptEnvelope()
Accessors
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]


Class ReceiptPrinter
Name ReceiptPrinter
Base class(es)
Purpose Manage the printer that produces customer receipts
States
Constructors ReceiptPrinter()
Operations
Mutators printReceipt(theATMnumber, theATMlocation, cardNumber,
serialNumber,description, amount, balance,
availableBalance)
Accessors
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]


Class OperatorPanel
Name OperatorPanel
Base class(es)
Purpose Manage the panel that allows the operator to start/stop
the machine, and to enter initial cash amount.
States Switch in running position
Switch in stopped position
Constructors OperatorPanel()
Operations
Mutators switchOn()
getInitialCash()
Accessors
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]


Class Session
Name Session
Base class(es)
Purpose Perform a session use case
States running
aborted due to repeated invalid PINs
Constructors Session(cardNumber, atm, bank)
Operations
Mutators doSessionUseCase()
doInvalidPINExtension()
doFailedTransactionExtension(reason)
Accessors cardNumber()
PIN()
Fields _cardNumber
_atm
_bank
_state
_PIN
_currentTransaction

[ View C++ class declaration code ] [ View Java interface documentation ]


Class Transaction
Name Transaction
Base class(es)
Purpose Abstract common features of the various types of transaction
use cases
States
Constructors Transaction(session, atm, bank)
chooseTransaction(session, atm, bank)
Operations
Mutators doTransactionUseCase()
(abstract) getTransactionSpecificsFromCustomer()
(abstract) sendToBank()
(abstract) finishApprovedTransaction()
Accessors
Fields _session
_atm
_bank
_serialNumber
_newBalance
_availableBalance
static _lastSerialNumberAssigned

[ View C++ class declaration code ] [ View Java interface documentation ]


Class WithdrawlTransaction
Name WithdrawlTransaction
Base class(es) Transaction
Purpose Perform a withdrawl transaction use case
States
Constructors WithdrawlTransaction(session, atm, bank)
Operations
Mutators getTransactionSpecificsFromCustomer()
sendToBank()
finishApprovedTransaction()
Accessors
Fields _fromAccount
_amount

[ View C++ class declaration code ]
(Java interface documentation same as for class Transaction)


Class DepositTransaction
Name DepositTransaction
Base class(es) Transaction
Purpose Perform a deposit transaction use case
States
Constructors DepositTransaction(session, atm, bank)
Operations
Mutators getTransactionSpecificsFromCustomer()
sendToBank()
finishApprovedTransaction()
Accessors
Fields _toAccount
_amount

[ View C++ class declaration code ]
(Java interface documentation same as for class Transaction)


Class TransferTransaction
Name TransferTransaction
Base class(es) Transaction
Purpose Perform a transfer transaction use case
States
Constructors TransferTransaction(session, atm, bank)
Operations
Mutators getTransactionSpecificsFromCustomer()
sendToBank()
finishApprovedTransaction()
Accessors
Fields _fromAccount
_toAccount
_amount

[ View C++ class declaration code ]
(Java interface documentation same as for class Transaction)


Class InquiryTransaction
Name InquiryTransaction
Base class(es) Transaction
Purpose Perform an inquiry transaction use case
States
Constructors InquiryTransaction(session, atm, bank)
Operations
Mutators getTransactionSpecificsFromCustomer()
sendToBank()
finishApprovedTransaction()
Accessors
Fields _fromAccount

[ View C++ class declaration code ]
(Java interface documentation same as for class Transaction)


Class Bank
Name Bank
Base class(es)
Purpose Manage communications with the bank
States
Constructors Bank()
Operations
Mutators initiateWithdrawl(cardNumber, PIN, ATMnumber, serialNumber,
from, amount,newBalance, availableBalance)
finishWithdrawl(ATMnumber, serialNumber, succeeded)
initiateDeposit(cardNumber, PIN, ATMnumber, serialNumber,
to, amount, newBalance, availableBalance)
finishDeposit(ATMnumber, serialNumber, succeeded)
doTransfer(cardNumber, PIN, ATMnumber, serialNumber,
from, to, amount, newBalance, availableBalance)
doInquiry(cardNumber, PIN, ATMnumber, serialNumber,
from, newBalance, availableBalance)
Accessors chooseAccountType(purpose, atm)
accountName(type)
rejectionExplanation(code)
Fields

[ View C++ class declaration code ] [ View Java interface documentation ]