1 / 19

Service Representative

1. Service Representative. Customer. :Mark I Vending Machine (MIVM) System. 1..*. 1. customer. supplier. 1..*. 1. servicer. vending machine. 4. Client Interface Layer. Coordination Layer. The model layer contains 2 packages: Role package Dispenser package. Model Layer.

tanith
Télécharger la présentation

Service Representative

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1 Service Representative Customer :Mark I Vending Machine (MIVM) System 1..* 1 customer supplier 1..* 1 servicer vending machine

  2. 4 Client Interface Layer Coordination Layer • The model layer contains • 2 packages: • Role package • Dispenser package Model Layer Server Interface Layer Foundation Layer

  3. CurrentModeProxy currentMode valid (aBill) valid (aCoin) doorLocked () selected (aLetter) selected (anInteger) changeMode () refund () 5 BillValidator inserted (aBill) CoinValidator inserted (aCoin) RefundButton pressed () LetterSelectionButtons pressed () NumberSelectionButtons pressed () ModeButton pressed () DoorSwitch tripped () Door locked () CustomOperatingSystemInterrupts event (aString) CLIENT INTERFACE 10 8

  4. CurrentModeProxy curentMode valid (aBill) valid (aCoin) doorLocked () selected (aString) selected (anInteger) changeMode () refund () 6 DispenseItemMode displayMessages () refund () reset () selected (anInteger) selected (aLetter) valid (aMoney) Customer displayMessages () refund () reset () selected (anInteger) selected (aLetter) valid (aMoney) SetPricemode refund () reset () selected (anInteger) selected (aLetter) valid (aMoney) DisplayHistoryMode refund () reset () selected (anInteger) selected (aLetter) valid (aMoney) ServiceRepresentative coinDispenserAssemblyLoaded () displayTotalIncome () displayTotalItemsSold () reset () selected (anInteger) selected (aLetter) MainDisplay display (currentMode) COORDINATION {contains}

  5. 8 CoinDispensingPolicy dispense () isPractical (aPrice) ItemDispensers dispense () price () price (aMoney) CoinSolenoid push () ItemStepperMode step (360) ItemDisplay display (aLocation,aPrice) ItemDispenserassembly dispenseAt (aLocation) priceAt (aLocation) priceAt (aLocation,aPrice) getTotalIncome () getTotalItemsSold () CoinDispenserAssembly isWarningNeeded () dispense (aMoney) inserted (aCoin) loaded () isPractical (aPrice) CoinDispensers haveCoin () coinInserted () next () coinType () dispense () DISPENSER {contains} 3 80 {contains} {contains}

  6. 9 CustomOperatingSystemCalls dispenseCoinFrom (aPort) dispenseItemFrom (aPort) itemDisplay (aString,aPort) mainDisplay (aString) CoinSolenoid push () ItemStepperMotor step (360) ItemDisplay display (aLocation,aPrice) MainDisplay display (aString) SERVER INTERFACE

  7. 11 Precondition: The mode is “DispenseItem”. Postcondition: The mode is “DispenseItem”. Make a Payment. :MIVM Software Insert a Valid Bill Insert a Valid Coin

  8. 12 Precondition: currentMode = dispenseItemMode Customer Inserts a Valid Bill. :Custom- OperatingSystem Interrupts :Custom- Operating- SystemCalls :Bill- Validator :Current- ModeProxy :Dispense- Item- Mode :Customer :Customer- Credit :Customer- Selection :Main- Display inserted (aBill) valid (aBill) valid (aBill) valid (aBill) add (aBill) creditIncremented () [itemSelected] Attempt to Dispense [no itemSelected] display () display (amount) displayMain (amount)

  9. :Coin- Dispenser- Assembly :Coin- Dispensing- Policy 13 Dispense Changes. :Customer- Credit dispense (credit) dispense (credit) [credit >= Money.none () ] Dispense Quarters [credit >= Money.none () ] Dispense Dimes [credit >= Money.none () ] Dispense Nickels Display Greeting

  10. :Coin- Dispensing- Policy :Coin- Dispensers :CustomOperating- SystemCalls aCoin- Dispenser :Coin- Solenoid 14 amountToDispense = credit.amount () Dispense Quarters. If a quarter was dispensed, then amountToDispense = amountToDispense – Coin.quarter () * [amountToDispense >= quarter] next () coinType () * [amountToDispense >= quarter and coinType () = Coin.quarter ()] dispense () push () dispenseCoinFrom (aPort) [quarter = not dispensed] FailedException NoCoinException CouldNotDispenseException

  11. 16 Hacer un Pago. :Software- MEA 1a: Insertar un Billete Válido 1b: Insertar una Moneda Válido

  12. 17 Precondition: currentMode = dispenseItemMode Insert a Valid Bill. :Custom- OperatingSystem- Interrupts 1: inserted (aBill) :Bill- Validator 1.1: valid (aBill) :Current- ModeProxy 1.1.1: valid (aBill) 1.1.1.1.2: credit- Incremented () :Customer- Selection :Customer 1.1.1.1: valid (aBill) :Dispense- Item- Mode 1.1.1.1.1: add (aBill) 1.1.1.1.2.2 [no itemSelected]: display () 1.1.1.1.2.2.1: display (amount) :Customer- Credit :Main- Display 1.1.1.1.2.1 [itemSelected]: 1.1.1.1.2.2.1.1: displayMain (amount) Attempt to Dispense :Custom- Operating- SystemCalls

  13. Dispense Changes. 18 :Coin- Dispenser- Assembly :Customer- Credit 1: dispense (credit) 1.1: dispense (credit) :Coin- Dispensing- Policy 1.1.1 [credit >= Money.none () ]: Dispense Quarters 1.1.2 [credit >= Money.none () ]: Dispense Dimes 1.1.3 [credit >= Money.none () ]: Dispense Nickels 1.1.4: Display Greeting

  14. 19 amountToDispense = credit.amount () Dispense Quarters. If a quarter was dispensed, then amountToDispense = amountToDispense – Coin.quarter () 2: coinType () 3 * [amountToDispense >= quarter and coinType () = Money.quarter ()]: dispense () :Coin- Dispensing- Policy aCoin- Dispenser 3.1.1.1.1.1: CouldNot-DispenseException 3.1.1.1.1: NoCoin-Exception 3.1: push () 1 * [amountToDispense >= quarter]: next () :CustomOperating- SystemCalls 3.1.1: dispenseCoinFrom (aPort) :Coin- Solenoid :Coin- Dispensers 3.1.1.1 [quarter = not dispensed]: FailedException

More Related