ATM Case Study1

Embed Size (px)

Citation preview

  • 8/8/2019 ATM Case Study1

    1/36

  • 8/8/2019 ATM Case Study1

    2/36

    Case Study A Bank wishes to introduce ATM service to providelimited facilities to her customers. Customers may get

    ATM cards on request. Users may view their balance or transfer or withdraw money using these cards. Cardsmay be used to access many accounts and an accountmay be accessed using different cards. A card may beblocked temporarily or permanently (e.g. If it is lost) bythe Bank. A PIN is associated with each card to verifythe authority of the user. There is an OD limit associatedwith each cheque account. Theoretically, any amountmay be withdrawn from a cheque account at any time(provided it is less than the balance+Odlimit). There isno OD facility for a savings account.

  • 8/8/2019 ATM Case Study1

    3/36

    Case Study (cty)

    The personal information of the customers andtheir account details are already maintained bythe Banks main system. A subsystem is

    required to handle the ATMs functionality. Twohardware systems Card reader and Moneydispenser will communicate with this subsystem.The card reader reads the Cards ID and passesit to the system. It is also able to eject the cardwhen an eject signal is received from thesystem. Similarly the money dispenser is able todispense the required amount of money.

  • 8/8/2019 ATM Case Study1

    4/36

    Case Study-3The Limited ATM system is required to provideat least the following operations.

    Enter a new card / new account detail

    Block /Reactivate/Cancel a cardView the balance of the accountWithdraw money from the accountTransfer money from one account to another

    Change the PIN of a cardThe validity of the card and the authority of theUser will be checked for each transaction session.

  • 8/8/2019 ATM Case Study1

    5/36

    Apply for Card

    Assign Pin

    Finalise Card

    Manager

    Record Detail

    Approve

    Receive Card

    ClerkClient

    :Card[Recorded]

    :Card[Approved]

    :Card[Finalised]

    :Card[active] Applying for

    New Card

    A Business Activity

    Diagram

  • 8/8/2019 ATM Case Study1

    6/36

    A Business

    ActivityDiagramInsert Card

    View Balance

    Select Service

    Client arrives at ATM

    Give PIN

    [CARD valid]

    [PIN OK]

    [Quit]

    Eject Card

    [CARD valid]

    [PIN OK]

    Withdraw

    [withdraw]

    Client

    TransactionClient leaves ATM

  • 8/8/2019 ATM Case Study1

    7/36

    Glossary

    ATM Card -Withdraw -

  • 8/8/2019 ATM Case Study1

    8/36

    Requirement List

    Client shall view the balanceClient shall withdraw money within a limitClient shall change the PIN

    Bank Clerk shall store a new CARD detailBank Clerk shall add another account to aCARD

    Shall check the CARDs validityShall verify the PINShall use 3-DCS (168 bits) encoding

  • 8/8/2019 ATM Case Study1

    9/36

    Grouping the Candidate Requirements

    CARD MANIPULATION Clerk store a new CARD detail Clerk add another account to a CARD

    Clerk & Client shall fix new PIN first time Client shall change the PIN

    TRANSACTIONS Client shall view the balance (within 2 minutes) Client shall withdraw money from savings/

    current account within the limit Client shall transfer money within the limit

  • 8/8/2019 ATM Case Study1

    10/36

    Client

    transfer

    withdraw

    view Balance

    Use Cases TransactionsTransactions

    Add structures

  • 8/8/2019 ATM Case Study1

    11/36

    Client

    transfer

    withdraw

    view Balance

    Use Cases TransactionsTransactions

    print Balance

    get Accounts

    S tructures added

  • 8/8/2019 ATM Case Study1

    12/36

    Clerk

    add new account

    add new card

    fix PIN

    Use Cases Card ManipulationCard Manipulation

    Client

    Add structures

  • 8/8/2019 ATM Case Study1

    13/36

    Clerk

    add new account

    add new card

    fix PIN

    Use Cases Card ManipulationCard Manipulation

    Client

  • 8/8/2019 ATM Case Study1

    14/36

    ATM- Withdraw From CurrentName : Withdraw From Current

    Actor : ClientPre-conditions : User already logged-in

    A menu is active with withdraw optionPost-conditions : Amount is deducted from users accountPurpose : To allow the client to withdraw moneyDescription:

    (1) Client initiates this usecase by selecting withdraw(2) System get all the accounts (use case get Account)(3) System displays all the accounts and prompts to select any one(3) Client selects one account(4) System prompts for the amount(5) Client indicate an amount(6) System issues money, update record, and confirms

    Alternative courses:(3) & (4) System selects the only one available account(6) requested amount is bigger than balance, system display message

    Errors:

    Issue Cash?

  • 8/8/2019 ATM Case Study1

    15/36

    Usecase Description-

    Withdraw from Savings

  • 8/8/2019 ATM Case Study1

    16/36

    Prototype

    Withdraw from CurrentSelect A ServiceWithdrawView BalanceTransfer

    Select An AccountChequeSavings (House)Credit

    Give An Amount

    OK

    Suceess

    Take Your Money Another Transaction?Get Your Card? OK

    OK

  • 8/8/2019 ATM Case Study1

    17/36

    ATM-Withdraw System gets

    all accounts

    Client selectsFast cash

    Client Select One Account

    Client selecetd withdraw

    Displays allaccounts

    [accounts>1]

    Eject Card

    [account=1]

    System asks for Amount to withdraw

    [amount > balance]Client types

    amount

    Issue cash

    Display message

    [amount > balance]

    [Quit]

  • 8/8/2019 ATM Case Study1

    18/36

    Complete other Usecases!

    View BalanceTransfer

    Add CardAdd AccountChange PIN

    Change StatusCheck PIN

  • 8/8/2019 ATM Case Study1

    19/36

    ATM ; E-R Diagram Classes (ITE-1)

    ATMCustomer ATMCheque ATMSavings

    ATMCard

    custID

    getCustID()accIDbalanceoDlimit

    cardNopinstatus

    getAccID()setBalance()getBalance()

    getAccID()setBalance()getBalance()

    accIDbalance

    getCardID()setPIN()checkPIN()setStatus()getStatus()

    1..*1..*

    0..* 0..*

    1..*

    1

    0..*0..*

    1..* 1..*

    For the time being there isno need for an AssociationClass or Attributed

    Association

    What if, the date joined (an Account to a Card) attributeis important ?

  • 8/8/2019 ATM Case Study1

    20/36

    Realize Usecases

    Identify Systems TasksIdentify Collaborating ObjectsAllocate ResponsibilitiesDraw CRCDraw ColloborationAssign a Ctrl class (and a UI class- if necessary)for each usecase.Draw Collobaration againUpdate Class diagram

  • 8/8/2019 ATM Case Study1

    21/36

    Withdraw From CurrentName : Withdraw From Current

    Actor : ClientPre-conditions : User already logged-in

    A menu is active with withdraw optionPost-conditions : Amount is deducted from users accountPurpose : To allow the client to withdraw moneyDescription:

    (1) Client initiates this usecase by selecting withdraw(2) Sy stem get all the accounts (use case get Account)(3) Sy stem displays all the accounts and prompts to select any one(3) Client selects one account(4) Sy stem prompts for the amount(5) Client indicate an amount

    (6) Sy stem issues money, update record, and confirms Alternative courses:

    (3) & (4) System selects the only one available account(6) requested amount is bigger than balance, system display message

    Errors:

    Identify System s Tasks

    Identify Nouns

  • 8/8/2019 ATM Case Study1

    22/36

    System s Tasks Identified

    (1) System gets all the accounts on Card(2) System displays the details of Accounts

    (3) Prompts to select one(4 System prompts for the amount(5) System issue money

    (6) Update records (update what?)H ow to allocate these tasks to different classes?

  • 8/8/2019 ATM Case Study1

    23/36

    2

    Use case Realization!

    withdraw

    Client

    :Account :Card

    withdraw1

    Identify Collaborations

  • 8/8/2019 ATM Case Study1

    24/36

  • 8/8/2019 ATM Case Study1

    25/36

    Collaboration Diagram (Initial Idea)!

    Client ::Card

    ::Account

    getAllAccDetail() *getAccDetail()21

    withdraw(acc,amm)3withdraw(amm)4

  • 8/8/2019 ATM Case Study1

    26/36

    withdraw(am)

    ::withdrawUI ::withdrawCtrlClient

    ::Card::Cheque

    2

    1

    35.1

    getAllAccDetail()

    start U I()selectAccount

    withdraw(cID)

    *getAccDetail()1.1

    4 proAmount withdraw(acc,am)5

    0

    Collaboration Diagram,

    with U I and CTRL objects!

    Issue Cash?

  • 8/8/2019 ATM Case Study1

    27/36

    ATMCustomer ATMCheque ATMSavings

    ATMCard

    custID

    getCustID()accIDbalanceoDlimit accName

    cardNopinstatus

    getAccID()setBalance()getBalance()getAccDetail()withdraw(amo)

    getAccID()setBalance()getBalance()getAccDetail()withdraw(amo)

    accIDbalanceaccName

    getCardID()setPIN()getPIN()setStatus()getStatus()getAllAccDetail()

    1..*1..*

    0..*0..*

    1..*

    10..*0..*

    1..* 1..*

    Analysis Level Class Diagram : Ite-2

    ATMwdU I

    s tartUI();s electAcc();proAmount();

    ATMwdCTRL

    withdraw(cID)withdraw(aID,amo)

    What next? Identify Super-Sub & Aggregations

  • 8/8/2019 ATM Case Study1

    28/36

    Analysis Level Class Diagram (Ite-3) ATMCustomer

    ATMSavings

    ATMCard

    custIDgetCustID()

    cardNopinstatus

    ATMCheque

    oDlimit

    withdraw(amo)

    withdraw(amo)

    getCardID()setPIN()getPIN()setStatus()getStatus()getAllAccDetail()

    0..*

    1..*

    1..*

    1

    1..*

    ATMwdCTRL

    withdraw(cID)withdraw(aID,amo)

    ATMwdU I

    s tartUI();s electAcc();proAmount();

    ATMAccount

    getAccID()setBalance()getBalance()getAccDetail()withdraw(amo)

    accIDbalanceaccName

    1..*

  • 8/8/2019 ATM Case Study1

    29/36

    Analysis Level Class Diagram (ver-2) ATMCustomer

    ATMSavings

    ATMCard

    custIDgetCustID()

    cardNopinstatus

    ATMCheque

    oDlimit

    withdraw(amo)

    withdraw(amo)

    getCardID()setPIN()getPIN()setStatus()getStatus()getAllAccDetail()

    1..*

    1

    1..*

    ATMwdCTRL

    withdraw(cID)withdraw(aID,amo)

    ATMwdU I

    s tartUI();s electAcc();proAmount();

    ATMAccount

    getAccID()setBalance()getBalance()getAccDetail()withdraw(amo)

    accIDbalanceaccName

    1..*

    ATMCustAcc

    Which version is better, why?

  • 8/8/2019 ATM Case Study1

    30/36

    Sequence diagram

    :Card :Account

    getAllAccDetail()

    withdraw(acc,am)

    *getAccDetail( )

    Client

    withdraw(am)

    with entity objects only

    Use Case: withdraw

  • 8/8/2019 ATM Case Study1

    31/36

    With Boundary & Control Classes

    *getAccDetail():withdrawUI

    :withdrawCtrl :Card :Account

    withdraw()proAmount()

    withdraw()

    startUI() *getAllAccDetails()

    Client

    Use Case: withdraw

    selectAccount()

    Sequence diagram

    Issue Cash?

  • 8/8/2019 ATM Case Study1

    32/36

    State Transitions

    Include relevant State Transition Diagrams(or Activity Diagrams)

  • 8/8/2019 ATM Case Study1

    33/36

    StatechartPe nding

    OnUs e

    Laps e d

    fixP IN()

    afte r [1 y e ar]

    Card()

    CARD

    Active

    B lock e d

    s e tStatus()

    OnUse

    ~Card()

  • 8/8/2019 ATM Case Study1

    34/36

    Withdraw- Operation SpecificationPre- and Post-condition Pair

    pre-conditions:CARD is validACCOUNT is valid

    ACCOUNT is associated with CARDamount is valid

    post-conditions:if amount is greater than ACCOUNT.b alance

    value of ACCOUNT.b alance set equal toACCOUNT.b alance-amount

    value of result set equal to success

    otherwisevalue of result set equal to failure

    Issue Cash?

  • 8/8/2019 ATM Case Study1

    35/36

    Structured English- withdrawget all the accounts associated with CARDif there are more than one ACCOUNT

    Do while there is no more ACCOUNTS leftget all the details associated with ACCOUNTdisplay details

    endDo

    set ACCOUNT to user selected ACCOUNTelse

    set ACCOUNT to the only existing ACCOUNTendIfif ACCOUNT.balance is greater than amount

    set ACCOUNT.balance to ACCOUNT.balance amount

    set result to TRUE

    elseset result to FALSE

    endIfreturn result

    Issue Cash?

  • 8/8/2019 ATM Case Study1

    36/36

    Get AccountDetails

    [NoOfAccounts = 1]

    [amount < =A . balance]

    A.balance A.balance-amount

    Result TRUE

    List an Accountdetails

    AOnly Account

    Activity Diagram- Withdraw

    [NoOfAccounts > 1]

    Get amount Get UsersChoice (say A)

    [more]

    [no more]

    [amount >A . balance]

    Result FALSE

    Issue Cash?