您好,欢迎访问三七文档
Page1Chapter8DevelopingATMExamplewithUMLPage2ATMRequirements(1)Thesoftwaretobedesignedwillcontrolasimulatedautomatedtellermachine(ATM)having:•amagneticstripereaderforreadinganATMcard;•acustomerconsole(keyboardanddisplay)forinteractionwiththecustomer;•aslotfordepositingenvelopes;•adispenserforcash(inmultiplesof$20);•aprinterforprintingcustomerreceipts;•akey-operatedswitchtoallowanoperatortostartorstopthemachine;•andtheATMwillcommunicatewiththebank'scomputeroveranappropriatecommunicationlink.Page3ATMRequirements(2)TheATMmustbeabletoprovidethefollowingservicestothecustomer:1.Acustomermustbeabletomakeacashwithdrawalfromanysuitableaccountlinkedtothecard,inmultiplesof$20.00.2.Acustomermustbeabletomakeadeposittoanyaccountlinkedtothecard,consistingofcashand/orchecksinanenvelope.3.Acustomermustbeabletomakeatransferofmoneybetweenanytwoaccountslinkedtothecard.4.Acustomermustbeabletomakeabalanceinquiryofanyaccountlinkedtothecard.Page4ATMRequirements(3)•Acustomermustbeabletoabortatransaction;•TheATMwillcommunicateeachtransactiontothebankandobtainverificationthatitwasallowedbythebank;•TheATMwillprovidethecustomerwithaprintedreceiptforeachsuccessfultransaction;•TheATMwillhaveakey-operatedswitchthatwillallowanoperatortostartandstoptheservicingofcustomers;•TheATMwillalsomaintainaninternallogoftransactions.Page5UseCaseInvalidPINWithdrawalDepositTransferInquirySystemStartupSystemShutdownOperatorSessionCustomerTransactionincludeextendBankPage6SystemStartupSequenceDiagram:OperatorPanel:ATM:CashDispenser:NetworktoBankSwitchOn()performStartup()getInitialCash()InitialCash()setInitialCash(InitialCash)OpenConnection()Page7SystemShutdownSequenceDiagram:OperatorPanel:ATM:NetworktoBankSwitchOff()PerformShutdown()CloseConnection()Page8SessionSequenceDiagram:CardReader:ATM:Session:CustomerConsole:TransactionCardInserted()create(this)performSession()ReadCard()cardreadPin()pincreate(atm,this,card,pin)performTransaction()doAgain[whilecustomerwantstoperformtranstions]ejectCard()Page9TransactionSequenceDiagramPage10WithdrawalTransactionCollaborationPage11DepositTransactionCollaborationPage12TransferTransactionCollaborationPage13InquiryTransactionCollaborationPage14InvalidPINExtensionCollaborationPage15AnalysisClassesOperator(fromUseCaseView)...)OperatorPanelCardReaderATM(fromatm)CardCustomer(fromUseCaseView)...)LogCustomerConsoleSessionReceiptPrinterCashDispenserEnvelopeAcceptorTransactionBank(fromUseCaseView)...)NetworktoBankPage16CRCClassATMResponsibilities•Startupwhenswitchisturnedon•Shutdownwhenswitchisturnedoff•StartanewsessionwhencardisinsertedbycustomerCollaborators•OperatorPanel•CashDispenser•NetworkToBank•CustomerConsole•SessionPage17CRCClassCardReaderResponsibilities•TellATMwhencardisinserted•Readinformationfromcard•Ejectcard•RetaincardCollaborators•ATM•CardBoundary/entityobjectsPage18CRCClassCashDispenserResponsibilities•Keeptrackofcashonhand,startingwithinitialamount•Reportwhetherenoughcashisavailable•DispensecashCollaborators•LogBoundary/entityobjectsPage19CRCClassCustomerConsoleResponsibilities•Displayamessage•Displayaprompt,acceptaPINfromkeyboard•Displayapromptandmenu,acceptachoicefromkeyboard•Displayaprompt,acceptadollaramountfromkeyboard•RespondtocancelkeybeingpressedbycustomerCollaboratorsBoundary/entityobjectsPage20CRCClassEnvelopeAcceptorResponsibilities•Acceptenvelopefromcustomer;reportiftimedoutorcancelledCollaborators•LogBoundary/entityobjectsPage21CRCClassLogResponsibilities•Logmessagessenttobank•Logresponsesfrombank•Logdispensingofcash•LogreceivinganenvelopeCollaboratorsBoundary/entityobjectsPage22CRCClassNetworkToBankResponsibilities•Initiateconnectiontobankatstartup•Sendmessagetobankandwaitforresponse•TerminateconnectiontobankatshutdownCollaborators•Message•LogBoundary/entityobjectsPage23CRCClassOperatorPanelResponsibilities•InformATMofchangestostateofswitch•AllowoperatortospecifyamountofinitialcashCollaborators•ATMBoundary/entityobjectsPage24CRCClassReceiptPrinterResponsibilities•PrintreceiptCollaborators•ReceiptBoundary/entityobjectsPage25CRCClassSessionResponsibilities•Performsessionusecase•UpdatePINvalueifcustomerhastore-enteritCollaborators•ATM•CardReader•Card•CustomerConsole•TransactionControlobjectsPage26CRCAbstractClassTransactionResponsibilities•Allowcustomertochooseatypeoftransaction•PerformTransactionUseCase•PerforminvalidPINextensionCollaborators•ATM•CustomerConsole•Withdrawal•Transfer•Deposit•Inquiry•Message•NetworkToBank•ReceiptPrinter•Session•CardReaderControlobjectsPage27CRCClassWithdrawalResponsibilities•PerformoperationspeculiartowithdrawaltransactionusecaseCollaborators•CustomerConsole•CashDispenser•Message•ReceiptControlobjectsPage28CRCClassDepositResponsibilities•PerformoperationspeculiartodeposittransactionusecaseCollaborators•CustomerConsole•Message•EnvelopeAcceptor•ReceiptControlobjectsPage29CRCClassTransferResponsibilities•PerformoperationspeculiartotransfertransactionusecaseCollaborators•CustomerConsole•Message•ReceiptControlobjectsPage30CRCClassInquiryResponsibilities•Perfo
本文标题:OOAD_8
链接地址:https://www.777doc.com/doc-3608725 .html