lecture - york universityjackie/teaching/lectures/2019...sign of a reservation:gitgond atempg...

12
Wednesday March 13 Lecture 17

Upload: others

Post on 18-Jan-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Wednesday March 13

Lecture 17

Page 2: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

State Transition Diagram ( FSM )Transition Table

Finite State Machine

-

①wrong

choice

Page 3: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Design of a Reservation System : First Attempt

- DebuggingC spa . . odes

.

- Sep.

C duplicates 1%9? I-

Reusability'

II't trains. of

e¥¥⇐€①I

→ Display -

Page 4: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Design of a Reservation System : Gand Attempt CD

a s→

-

o I-00→

O D

e.g .

transitionStates-↳y[zy

States s2 ]transition(3+3) -

Transition Table 27 - Array Implementation

DO D⑨-

@ @-

Page 5: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Design of a Reservation

ffystem: a Top -

Down Design

€0ns→

D

Page 6: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

he sign of a Reservation GIT: Gond

AtemPg④⑧←I- -

Ia

Page 7: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Design of a Reservation System : Second Attempt

=case current State of

→ : ARRAY -LI : -

z : -

o- ii. =

Toti

: =

Page 8: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

delete state

Zaddstate 7

di#s:Iif s -

- I they if 5- I then

D Dµ¥ldseyfsz.me#else As they else if £3 the:D;Delse ?El then

else-45-7then

Page 9: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Design of a Reservation System : Second Attempt

Page 10: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Moving fan Hierarchical Design to 00 Design

00 ←

Current -State : STATE

current - State .execute - session

+

,HIERARCHICAL#i÷÷÷÷.÷÷÷÷÷÷÷

Page 11: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

Non - 00# I

Current - State : = 2

→eXecnte_state(currert_sta-#

Current - state : = 4

→eXeate_statecavrentf#Of.

u

changecaput

a to

contextobject.

current -State : STATE

create I FLIGHT,

INA 'S current - State.make

→ current - State. execute

create { RESERVATIONS current -State

.make

Current- State . execute

Page 12: Lecture - York Universityjackie/teaching/lectures/2019...sign of a Reservation:GITGond AtemPg ④⑧←-I-I a Design of a ReservationSystem: Second Attempt =case current State of →:

STATE PATTERN :

Architecture

⇒→

execrates¥a*tdendt ⑨⑧-

[email protected]

:* .