lecture - york universityjackie/teaching/lectures/2019...sign of a reservation:gitgond atempg...
TRANSCRIPT
Wednesday March 13
Lecture 17
State Transition Diagram ( FSM )Transition Table
Finite State Machine
-
①wrong
choice
Design of a Reservation System : First Attempt
- DebuggingC spa . . odes
.
- Sep.
C duplicates 1%9? I-
Reusability'
II't trains. of
e¥¥⇐€①I
→ Display -
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⑨-
@ @-
Design of a Reservation
ffystem: a Top -
Down Design
€0ns→
D
he sign of a Reservation GIT: Gond
AtemPg④⑧←I- -
Ia
Design of a Reservation System : Second Attempt
=case current State of
→ : ARRAY -LI : -
z : -
o- ii. =
Toti
: =
•
•
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
Design of a Reservation System : Second Attempt
Moving fan Hierarchical Design to 00 Design
00 ←
Current -State : STATE
current - State .execute - session
+
,HIERARCHICAL#i÷÷÷÷.÷÷÷÷÷÷÷
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