Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Service Representative Customer customer 11..* 1 :Mark I Vending Machine (MIVM) System supplier servicer 1 vending machine 1..*"— Presentation transcript:

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

2

3

4 The model layer contains 2 packages: Role package Dispenser package 4 Client Interface LayerCoordination LayerModel LayerServer Interface LayerFoundation Layer

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

6 COORDINATION 6 CurrentModeProxy curentMode valid (aBill) valid (aCoin) doorLocked () selected (aString) selected (anInteger) changeMode () refund () DispenseItemMode 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) Customer displayMessages () refund () reset () selected (anInteger) selected (aLetter) valid (aMoney) ServiceRepresentative coinDispenserAssemblyLoaded () displayTotalIncome () displayTotalItemsSold () reset () selected (anInteger) selected (aLetter) MainDisplay display (currentMode) {contains}

7

8 DISPENSER 8 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 () CoinDispensingPolicy dispense () isPractical (aPrice) ItemDispensers dispense () price () price (aMoney) CoinSolenoid push () ItemStepperMode step (360) ItemDisplay display (aLocation,aPrice) 80 3 {contains}

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

10

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

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

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

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

15

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

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

18 18 :Customer- Credit :Coin- Dispenser- Assembly :Coin- Dispensing- Policy 1: dispense (credit) 1.1: dispense (credit) Dispense Changes. 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

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


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

Similar presentations


Ads by Google