欢迎来到163文库! | 帮助中心 精品课件PPT、教案、教学设计、试题试卷、教学素材分享与下载!
163文库
全部分类
  • 办公、行业>
  • 幼教>
  • 小学>
  • 初中>
  • 高中>
  • 中职>
  • 大学>
  • 各类题库>
  • ImageVerifierCode 换一换
    首页 163文库 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    软件工程课件:8-第八讲(2).ppt

    • 文档编号:2046002       资源大小:1.26MB        全文页数:75页
    • 资源格式: PPT        下载积分:9.5文币     交易提醒:下载本文档,9.5文币将自动转入上传用户(罗嗣辉)的账号。
    微信登录下载
    快捷注册下载 游客一键下载
    账号登录下载
    二维码
    微信扫一扫登录
    下载资源需要9.5文币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    优惠套餐(点此详情)
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、试题类文档,标题没说有答案的,则无答案。带答案试题资料的主观题可能无答案。PPT文档的音视频可能无法播放。请谨慎下单,否则不予退换。
    3、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者搜狗浏览器、谷歌浏览器下载即可。。

    软件工程课件:8-第八讲(2).ppt

    1、Page 1Chapter 8 Developing ATM Examplewith UMLPage 2ATM Requirements (1) The software to be designed will control a simulated automated teller machine (ATM) having: a magnetic stripe reader for reading an ATM card; a customer console (keyboard and display) for interaction with the customer; a slot f

    2、or depositing envelopes; a dispenser for cash (in multiples of $20); a printer for printing customer receipts; a key-operated switch to allow an operator to start or stop the machine; and the ATM will communicate with the banks computer over an appropriate communication link.Page 3ATM Requirements (

    3、2) The ATM must be able to provide the following services to the customer: 1. A customer must be able to make a cash withdrawal from any suitable account linked to the card, in multiples of $20.00. 2. A customer must be able to make a deposit to any account linked to the card, consisting of cash and

    4、/or checks in an envelope.3. A customer must be able to make a transfer of money between any two accounts linked to the card.4. A customer must be able to make a balance inquiry of any account linked to the card.Page 4ATM Requirements (3) A customer must be able to abort a transaction; The ATM will

    5、communicate each transaction to the bank and obtain verification that it was allowed by the bank; The ATM will provide the customer with a printed receipt for each successful transaction; The ATM will have a key-operated switch that will allow an operator to start and stop the servicing of customers

    6、; The ATM will also maintain an internal log of transactions.Page 5Use CaseInvalid PINWithdrawalDepositTransferInquirySystem StartupSystem ShutdownOperatorSessionCustomerTransactionBankPage 6System Startup Sequence Diagram : Operator Panel : ATM : Cash Dispenser : Network to BankSwitchOn( )performSt

    7、artup( )getInitialCash( )InitialCash( )setInitialCash(InitialCash)OpenConnection( )Page 7System Shutdown Sequence Diagram : Operator Panel : ATM : Network to BankSwitchOff( )PerformShutdown( )CloseConnection( )Page 8Session Sequence Diagram : Card Reader : ATM : Session : Customer Console : Transact

    8、ionCardInserted( )(this)performSession( )ReadCard( )cardreadPin( )pin(atm,this,card,pin)performTransaction( )doAgain while customer wants to perform transtionsejectCard( )Page 9Transaction Sequence DiagramPage 10Withdrawal Transaction CollaborationPage 11Deposit Transaction CollaborationPage 12Trans

    9、fer Transaction CollaborationPage 13Inquiry Transaction CollaborationPage 14Invalid PIN Extension CollaborationPage 15Analysis ClassesOperator(from Use Case View).)Operator PanelCard ReaderATM(from atm)CardCustomer(from Use Case View).)LogCustomer ConsoleSessionReceipt PrinterCash DispenserEnvelope

    10、AcceptorTransactionBank(from Use Case View).)Network to BankPage 16CRCClass ATMResponsibilities Start up when switch is turned on Shut down when switch is turned off Start a new session when card is inserted by customerCollaborators OperatorPanel CashDispenser NetworkToBank CustomerConsole SessionPa

    11、ge 17CRCClass CardReaderResponsibilities Tell ATM when card is inserted Read information from card Eject card Retain cardCollaborators ATM CardBoundary/entity objectsPage 18CRCClass CashDispenserResponsibilities Keep track of cash on hand, starting with initial amount Report whether enough cash is a

    12、vailable Dispense cashCollaborators LogBoundary/entity objectsPage 19CRCClass CustomerConsoleResponsibilities Display a message Display a prompt, accept a PIN from keyboard Display a prompt and menu, accept a choice from keyboard Display a prompt, accept a dollar amount from keyboard Respond to canc

    13、el key being pressed by customerCollaboratorsBoundary/entity objectsPage 20CRCClass EnvelopeAcceptorResponsibilities Accept envelope from customer; report if timed out or cancelledCollaborators LogBoundary/entity objectsPage 21CRCClass LogResponsibilities Log messages sent to bank Log responses from

    14、 bank Log dispensing of cash Log receiving an envelopeCollaboratorsBoundary/entity objectsPage 22CRCClass NetworkToBankResponsibilities Initiate connection to bank at startup Send message to bank and wait for response Terminate connection to bank at shutdownCollaborators Message Log Boundary/entity

    15、objectsPage 23CRCClass OperatorPanelResponsibilities Inform ATM of changes to state of switch Allow operator to specify amount of initial cashCollaborators ATMBoundary/entity objectsPage 24CRCClass ReceiptPrinterResponsibilities Print receiptCollaborators ReceiptBoundary/entity objectsPage 25CRCClas

    16、s SessionResponsibilities Perform session use case Update PIN value if customer has to re-enter itCollaborators ATM CardReader Card CustomerConsole Transaction Control objectsPage 26CRCAbstract Class TransactionResponsibilities Allow customer to choose a type of transaction Perform Transaction Use C

    17、ase Perform invalid PIN extension Collaborators ATM CustomerConsole Withdrawal Transfer Deposit Inquiry Message NetworkToBank ReceiptPrinter Session CardReaderControl objectsPage 27CRCClass WithdrawalResponsibilities Perform operations peculiar to withdrawal transaction use case Collaborators Custom

    18、erConsole CashDispenser Message Receipt Control objectsPage 28CRCClass DepositResponsibilities Perform operations peculiar to deposit transaction use case Collaborators CustomerConsole Message EnvelopeAcceptor ReceiptControl objectsPage 29CRCClass TransferResponsibilities Perform operations peculiar

    19、 to transfer transaction use case Collaborators CustomerConsole Message ReceiptControl objectsPage 30CRCClass InquiryResponsibilities Perform operations peculiar to inquiry transaction use case Collaborators CustomerConsole Message Receiptcontrol objectsPage 31CRCClass BalancesResponsibilities Repre

    20、sent account balance information returned by bankCollaboratorsentity objectsPage 32CRCClass CardResponsibilities Represent information encoded on customers ATM cardCollaboratorsentity objectsPage 33CRCClass MessageResponsibilities Represent information to be sent over network to bankCollaboratorsent

    21、ity objectsPage 34CRCClass ReceiptResponsibilities Represent information to be printed on a receiptCollaboratorsentity objectsPage 35CRCClass StatusResponsibilities Represent transaction status information returned by bankCollaboratorsentity objectsPage 36Class DiagramPage 37Statecharts for Control

    22、Objects: ATMOFFentry/ display Not availableIDLEentry/ display please insert cardswitch turned on / perform startupSERVING CUSTOMERswitch turned off / perform shutdowncard inserted / create sessionsession completed or abortedPage 38Statecharts for control objects: SessionREADING CARDREADING PINCHOOSI

    23、NG TRANSACTIONPERFORMING TRANSACTIONEJECTING CARDCustomer finishedCustomer wants to anotherAborted due to too many invalid PINS-card retainedtransaction chosenCancel pressedPIN read successfullyCancel pressedCard read successfullyCard not readable / display Card not readablePage 39Statecharts for co

    24、ntrol objects: TransactionGETTING SPECIFICSSENDING TO BANKHANDLING INVALID PINCOMPLETING TRANSACTIONPRINTING RECEIPTASKING IF CUSTOMER WANTS ANOTHERNot cancelledCancelledInvalid PINApprovedDisapproved( except Invalid PIN )Specifics enteredCancelledApprovedDisapproved(except Invalid PIN) or Cancelled

    25、Too many invalid PINsPage 40Package DiagramATMMainATMAppletatmSessionATM(from atm)transactionPhysicalBanking+CardReader+CashDispenser+CustomerConsole+EnvelopeAcceptor+Log+NetworkToBank+OperatorPanel+ReceiptPrinter+Transaction+Withdrawal+Deposit+Transfer+Inquiry+AccountInformation+Balances+Card+Messa

    26、ge+Money+Receipt+StatusPage 41Detail Design of ClassesATM - id: int - place: String - bankName: String - bankAddress: InetAddress - cardReader: CardReader - cashDispenser: CashDispenser - customerConsole: CustomerConsole - envelopeAcceptor: EnvelopeAcceptor - log: Log - networkToBank: NetworkToBank

    27、- operatorPanel: OperatorPanel - receiptPrinter: ReceiptPrinter - state: int - switchOn: boolean - cardInserted: boolean - OFF_STATE: final int - IDLE_STATE: final int - SERVING_CUSTOMER_STATE: final int Page 42Detail Design of Classes-+ ATM(id: int, place: String, bankName: String, bankAddress: Ine

    28、tAddress) + run() + switchOn() + switchOff + cardInserted() + getID(): int + getPlace(): String + getBankName(): String + getCardReader(): CardReader + getCashDispenser(): CashDispenser + getCustomerConsole(): CustomerConsole + getEnvelopeAcceptor(): EnvelopeAcceptor + getLog(): Log + getNetworkToBa

    29、nk(): NetworkToBank + getOperatorPanel(): OperatorPanel + getReceiptPrinter(): ReceiptPrinter - performStartup() - performShutdown() Page 43Detail Design of ClassesCardReader - - atm: ATM - + CardReader(atm: ATM) + readCard(): Card + ejectCard() + retainCard() Page 44Detail Design of ClassesCashDisp

    30、enser - - log: Log - cashOnHand: Money - + CashDispenser(log: Log) + setInitialCash(initialCash: Money) + checkCashOnHand(amount: Money): boolean + dispenseCash(amount: Money) Page 45Detail Design of ClassesCustomerConsole - - + CustomerConsole() + display(message: String) + readPIN(prompt: String):

    31、 int throws Cancelled + readMenuChoice(prompt: String, menu: String ): int throws Cancelled + readAmount(prompt: String): Money throws Cancelled Page 46Detail Design of ClassesEnvelopeAcceptor - - log: Log - + EnvelopeAcceptor(log: Log) + acceptEnvelope() throws Cancelled Page 47Detail Design of Cla

    32、ssesLog - - + Log() + logSend(message: Message) + logResponse(status: Status) + logCashDispensed(amount: Money) + logEnvelopeAccepted() Page 48Detail Design of ClassesNetworkToBank - - log: Log - bankAddress: InetAddress - + NetworkToBank(log: Log, bankAddress: InetAddress) + openConnection() + clos

    33、eConnection() + sendMessage(message: Message, out balances: Balances): Status Page 49Detail Design of ClassesOperatorPanel - - atm: ATM - + OperatorPanel(atm: ATM) + getInitialCash(): Money Page 50Detail Design of ClassesReceiptPrinter - - + ReceiptPrinter() + printReceipt(receipt: Receipt) Page 51D

    34、etail Design of ClassesSession - atm: ATM - pin: int - state: int - READING_CARD_STATE: final int - READING_PIN_STATE: final int - CHOOSING_TRANSACTION_STATE: final int - PERFORMING_TRANSACTION_STATE: final int - EJECTING_CARD_STATE: final int -FINAL_STATE: final int - + Session(atm: ATM) + performS

    35、ession() + setPIN(int pin)Page 52Detail Design of ClassesTransaction -# atm: ATM # session: Session # card: Card # pin: String# serialNumber: int # message: Message # balances: Balances - TRANSACTION_TYPES_MENU: final String - nextSerialNumber: int - state: int - GETTING_SPECIFICS_STATE: final int -

    36、 SENDING_TO_BANK_STATE: final int - INVALID_PIN_STATE: final int - COMPLETING_TRANSACTION_STATE: final int - PRINTING_RECEIPT_STATE: final int - ASKING_DO_ANOTHER_STATE: final int Page 53Detail Design of Classes- # Transaction(atm: ATM, session: Session, card: Card, pin: int) + makeTransaction(atm:

    37、ATM, session: Session, card: Card, pin: int): Transaction throws Cancelled + performTransaction(): boolean throws CardRetained + performInvalidPinExtension(): Status throws Cancelled, CardRetained + getSerialNumber(): int # getSpecificsFromCustomer(): Message throws Cancelled # completeTransaction()

    38、: Receipt throws Cancelled Page 54Detail Design of ClassesWithdrawal - - from: int - amount: Money - + Withdrawal(atm: ATM, session: Session, card: Card, pin: int) # getSpecificsFromCustomer(): Message throws Cancelled # completeTransaction(): ReceiptPage 55Detail Design of ClassesDeposit - - to: in

    39、t - amount: Money - + Deposit(atm: ATM, session: Session, card: Card, pin: int) # getSpecificsFromCustomer(): Message throws Cancelled # completeTransaction(): Receipt throws Cancelled Page 56Detail Design of ClassesTransfer - - from: int - to: int - amount: Money - + Transfer(atm: ATM, session: Ses

    40、sion, card: Card, pin: int) # getSpecificsFromCustomer(): Message throws Cancelled # completeTransaction(): Receipt Page 57Detail Design of ClassesInquiry - - from: int - + Inquiry(atm: ATM, session: Session, card: Card, pin: int) # getSpecificsFromCustomer(): Message throws Cancelled # completeTran

    41、saction(): Receipt Page 58Detail Design of ClassesAccountInformation - + ACCOUNT_NAMES: final String + ACCOUNT_ABBREVIATIONS: final String Page 59Detail Design of ClassesBalances - - total: Money - available: Money - + Balances() + setBalances(total: Money, available: Money) + getTotal(): Money + ge

    42、tAvailable(): MoneyPage 60Detail Design of ClassesCard - - number: int - + Card(number: int) + getNumber(): int Page 61Detail Design of ClassesMessage - + WITHDRAWAL: final int + INITIATE_DEPOSIT: final int + COMPLETE_DEPOSIT: final int + TRANSFER: final int + INQUIRY: final int - messageCode: int -

    43、 card: Card - pin: String - serialNumber: int - fromAccount: int - toAccount: int - amount: int Page 62Detail Design of Classes- + Message(messageCode: int, cardNumber: Card, pin: int, serialNumber: int, fromAccount: int, toAccount: int, amount: Money) + toString(): String + setPIN(pin: int) + getMe

    44、ssageCode(): int + getCard(): Card + getPIN(): String + getSerialNumber(): int + getFromAccount(): int + getToAccount(): int + getAmount(): Money Page 63Detail Design of ClassesMoney - - cents: long - + Money(dollars: int) + Money(dollars: int, cents: int) + Money(toCopy: Money) + toString(): String

    45、 + add(amountToAdd: Money) + subtract(amountToSubtract: Money) + lessEqual(compareTo: Money): booleanPage 64Detail Design of ClassesReceipt - - headingPortion: String # detailsPortion(): String - balancesPortion: String - # Receipt(atm: ATM, card: Card, transaction: Transaction, balances: Balances)

    46、+ getLines(): Enumeration Page 65Detail Design of ClassesStatus - - + toString(): String + isSuccess(): boolean + isInvalidPIN(): boolean + getMessage(): String Page 66Codepackage banking;public class Card public Card(int number) this.number = number; public int getNumber() return number; /* Card nu

    47、mber encoded on the card */ private int number;Page 67Codepackage banking;/* The static members of this class incorporate information about accounts * offered by the bank. Actual communication with the bank uses account type * numbers - e.g. 0 represents the first type of account listed. */public cl

    48、ass AccountInformation /* Names for accounts to be offered in menu to customer */ public static final String ACCOUNT_NAMES = Checking, Savings, Money Market ; /* Abbreviations for account names to be printed on receipts. */ public static final String ACCOUNT_ABBREVIATIONS = CHKG, SVGS, MMKT ; Page 6

    49、8Codepackage banking;public class Balances public Balances() public void setBalances(Money total, Money available) this.total = total; this.available = available; public Money getTotal() return total; public Money getAvailable() return available; private Money total; private Money available;Page 69C

    50、odepackage atm.physical;import banking.Money;import simulation.Simulation;public class CashDispenser public CashDispenser(Log log) this.log = log; cashOnHand = new Money(0); public void setInitialCash(Money initialCash) cashOnHand = initialCash; public boolean checkCashOnHand(Money amount) return am


    注意事项

    本文(软件工程课件:8-第八讲(2).ppt)为本站会员(罗嗣辉)主动上传,其收益全归该用户,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!




    Copyright@ 2017-2037 Www.163WenKu.Com  网站版权所有  |  资源地图   
    IPC备案号:蜀ICP备2021032737号  | 川公网安备 51099002000191号


    侵权投诉QQ:3464097650  资料上传QQ:3464097650
       


    【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。

    163文库