Atm Simulator
Upcoming SlideShare
Loading in...5
×
 

Atm Simulator

on

  • 10,058 views

Java Explanation of ATM Assignment.

Java Explanation of ATM Assignment.

Statistics

Views

Total Views
10,058
Views on SlideShare
10,058
Embed Views
0

Actions

Likes
4
Downloads
291
Comments
4

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Can anyone tell me where I can find an ATM simulator? All i need to do is be able to create a Pin code and try to let people guess it. So it has to be somewhat interactive. Thanks in advance.
    Are you sure you want to
    Your message goes here
    Processing…
  • very good , what about the maintenance or images to these process for examples .thanks for you
    Are you sure you want to
    Your message goes here
    Processing…
  • very good presentation
    Are you sure you want to
    Your message goes here
    Processing…
  • good
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Atm Simulator Atm Simulator Presentation Transcript

  • ATM Simulator
  • Software Life Cycle
    • Elicit requirements
      • describe use cases
    • Create a specification
    • Design
      • structure (classes and their relations)
      • behavior
      • state
    • Implement
    • Deploy
    • Maintain & Enhance
    What about testing and documentation ? Why aren't they listed as steps in the life cycle?
  • Unified Software Process
    • Iterative and Incremental
    • Perform multiple iterations
    • Incrementally (in each iteration) add functionality
      • Start with most important use cases or requirements
    View slide
  • ATM Simulator
    • Design and implement an ATM Simulator that simulates the functions of a real ATM.
    • The ATM will support PIN authentication, balance inquiry, and withdrawal. If time permits, we will add deposit and transfers.
    • Goals
    • Practice software development methodology using UML, interfaces, and inheritance.
    • Use O-O design to limit the complexity of implementation.
    View slide
  • ATM user interface (sort of) Our Simulator will have more buttons than this.
  • ATM main menu (sort of) Our Simulator may have more menu options than this.
  • ATM Phase 1
    • Develop requirements for an ATM with withdrawal and balance inquiry.
    • Implement a simple ATM engine and console interface.
    • Determine what public methods ( interface ) are needed for an ATM U.I.
    • Determine what services are needed from the Bank subsystem.
    • For this phase, we will use a dummy Bank. It approves all requests.
  • ATM Use Case: withdraw (1)
    • Description : Customer withdraws money from account
    • Actors : Bank customer with ATM card
    • Steps :
    • 1. ATM machine displays greeting.
    • 2. Customer inserts card.
    • 3. ATM reads card and prompts customer for PIN.
    • 4. Customer enters PIN.
    • 5. ATM contacts Bank to verify customer's PIN.
    • 6. Bank verifies PIN.
    • 7. ATM prompts customer for transaction type.
    • 8. Customer chooses withdraw.
  • ATM Use Case: withdraw (2)
    • 9. ATM asks customer to enter amount to withdraw.
    • 10. Customer enters amount.
    • 11. ATM verifies it has bills to provide this amount.
    • 12. ATM contacts Bank to verify customer can withdraw the requested amount.
    • 13. Bank verifies withdraw and debits customer's acct.
    • 14. ATM dispenses amount and prompts customer to take money.
    • 15. Customer takes money.
  • ATM Use Case: withdraw (3)
    • 16. ATM prints receipt and prompts customer to take it.
    • 17. Customer take receipt.
    • 18. ATM asks customer if he wants another transaction.
    • 19. Customer selects "no" option.
    • 20. ATM returns customer's card.
    • 21. Customer takes card.
  • ATM Use Case: withdraw (4)
    • Extensions and Alternatives :
    • Scenario : step 3, ATM cannot read valid acct number from ATM card.
    • 3a. ATM prints message describing problem.
    • 3b. execute steps 20-21 of main course.
    • Scenario : step 6. Bank indicates PIN is incorrect.
    • 6a. if count of failed PIN attempts is < 3, goto step 3. Otherwise, execute steps 20-21 of main course.
    • Scenario : step 11, customer's entry is not a number or ATM cannot dispense the requested amount.
    • 11a. Display message describing problem.
    • 11b. Return to step 9.
  • ATM Use Case: withdraw (5)
    • Extensions and Alternatives :
    • Scenario : at any time after authentication the customer presses CANCEL button.
    • __a. Return customer's card and prompt him to take it.
    • Extension : a customer may have more than one account. Enable customer to choose account for withdrawal.
    • Issue : if customer presses CANCEL should ATM return card or return to option's menu?
    • Issue : after 3 failed PIN attempts should ATM notify Bank for security reasons? I.e., temporarily lock-out this ATM card.
  • ATM Use Case: balance inquiry (1)
    • Description : Customer inquires his account balance
    • Actors : Bank customer with ATM card
    • Steps :
    • 1. ATM machine displays greeting.
    • 2. Customer inserts card.
    • 3. ATM reads card and prompts customer for PIN.
    • 4. Customer enters PIN.
    • 5. ATM contacts Bank to verify customer's PIN.
    • 6. Bank verifies PIN.
    • 7. ATM prompts customer for transaction type.
    • 8. Customer chooses balance inquiry.
  • ATM Use Case: balance inquiry (2)
    • To be completed.
  • ATM Use Case: deposit (1)
    • Description : Customer deposits funds (cash or checks) in account using a deposit envelop
    • Actors : Bank customer with ATM card and funds
    • Steps :
    • 1. ATM machine displays greeting.
    • 2. Customer inserts card.
    • 3. ATM reads card and prompts customer for PIN.
    • 4. Customer enters PIN.
    • 5. ATM contacts Bank to verify customer's PIN.
    • 6. Bank verifies PIN.
    • 7. ATM prompts customer for transaction type.
    • 8. Customer chooses deposit.
  • ATM Use Case: deposit (2)
    • To be completed.
  • Use Case Factoring and Diagram
    • Factor out common behavior from the use cases.
      • Steps 1 - 7 are the same in all use cases.
      • Displaying menu and choosing an option is another common task.
    • Draw a Use Case Diagram.
      • Helpful for visually actors and components.
      • Free UML editor: ArgoUML (argouml.tigris.org)
  • Specification
    • Use cases help you identify what a system should do.
    • A software specification document clarifies what the program should do.
      • This is usually part of a software contract.
      • Can be formal or informal, but must be written .
    • Specification will help identify classes and responsibilities.
  • Structure: identify classes
  • Nouns in the requirements document. Source: Dietel & Dietel, Java, How to Program .
  • Modeling Classes
    • UML class diagrams
      • Allows suppression of class attributes and operations
        • Called an elided diagram
      • Solid line that connects two classes represents an association
        • numbers near end of each line are multiplicity values
  • Class Diagram with Association
    • Attributes and methods are omitted (&quot; elided &quot;)
      • In early design phase, concentrate on identifying classes and responsibilities first.
      • numbers near end of each line are multiplicity
  • Modeling Classes
    • UML class diagrams
      • Solid diamonds attached to association lines indicate a composition relationship
      • Hollow diamonds indicate aggregation – a weaker form of composition
  • Class diagram for ATM U.I.
    • Association and Composition
      • Used when one object &quot;owns&quot; or controls another
      • Solid diamonds indicate composition relationship: the ATM is composed of these parts; the parts do not exist without the whole (ATM)
    Source: Dietel & Dietel, Java, How to Program
  • Class diagram for ATM U.I.
    • Association and Composition
      • Hollow (open) diamonds indicate association relationship: the whole possesses these parts, but the parts can exist without the whole.
      • Examples: a Stack has a LinkedList, a Mailbox has Messages
    LinkedList addFirst addLast addAfter removeFirst removeLast delete isEmpty Stack push pop isEmpty
  • D iagram for ATM with Withdrawal However, in our implementation we will separate UI from ATM functionality (deposit, withdraw, etc). Source: Dietel & Dietel, Java, How to Program
  • ATM with Separate User Interface
    • Separate ATM user interface from the class(es) that provide ATM functionality.
      • user interface is screen, keypad, card slot, money dispenser, etc.
    • Create a Java interface to define public methods.
    <<interface>> ATMInterface displayMessage ATMsim deposit( ) withdraw( ) balanceInquiry( ) ATM UI atmUI: ATMInterface ATM( atmUI ) <<ATM Logic Engine>>
  • ATM with Separate User Interface
    • Benefits of using an interface :
      • you can change the actual user interface without changing any other parts of the system
      • Example :
      • a class implementing ATMInterface is responsible for displaying messages, accepting input from keypad, reading ATM card, returning ATM card, printing receipts, and dispensing cash
      • for a GUI interface, we may decide to divide these responsibilities into separate classes
        • one main class, called a Façade , acts as interface between ATM Engine and the various component classes.
  • ATM with Separate User Interface
    • Separate ATM user interface from the class(es) that provide ATM functionality.
      • user interface is screen, keypad, card slot, money dispenser, etc.
    • Create a Java interface to define public methods.
    <<interface>> ATMInterface displayMessage ATM deposit( ) withdraw( ) balanceInquiry( ) ATM GUI atmUI: ATMInterface ATM( atmUI ) <<ATM Logic Engine>> Keypad Screen Card Slot
  • Identify Class Responsibilities
    • What are the main responsibilities of each class?
      • responsibilities are usually activities or actions
      • if a class doesn't have any responsibilities, it can be eliminated
    • Example :
      • initially write a console-based U.I. Later we will write a GUI for ATM.
      • multiple programmers can work on different parts of project simultaneously
      • helps to limit complexity and enforce good design
  • Identifying Class Attributes
    • Identifying attributes
      • Look for descriptive nouns and phrases in the requirements document
      • Eliminate some nouns:
        • (1) redundant, (2) abstract, (3) describe instances, (4) outside the problem boundary (domain)
      • Create attributes and assign them to classes
  • Possible Attributes for ATM System
  • First Iteration
    • Ignore the Bank and Account components.
    • No GUI interface.
    • Design a basic ATM engine, ATM interface (Java interface), and console-based UI.
    • Handle only a few transactions: withdraw, fast cash.
  • Design: use a state chart
    • A state chart diagram can help understand behavior.
    Wait for an ATM user Transaction Loop Start error Fail < 3 times Verify ATM card Verify PIN Code Fail 3 times or Cancel End Session / Return ATM card [Invalid/unreadable card]
  • Transaction Loop
    • UML state chart diagram for transaction loop
    Display Transactions Menu Deposit dialog Withdraw dialog Show Balance get deposit envelop error OK Transaction Loop END Exit OK OK verify input and available balance fail OK OK cancel cancel &quot;Deposit&quot; action &quot;Inquiry&quot; action &quot;Withdraw&quot; action
  • Second Iteration (due Tues 6/9/2005)
    • implement the ATMInterface.java as a console interface.
    • write an ATM simulator that does this:
      • read ATM card and PIN
      • display transaction menu
      • handle withdraw, fast cash, and balance inquiry
      • use the ATMInterface for all I/O
    • Design a Transaction class to encapsulate transactions.