Download presentation
Presentation is loading. Please wait.
Published bySuzanna Mills Modified over 8 years ago
1
School Exercises: A Component-based Model of a Phone Components use and implement interfaces Protocol statecharts model the accepted orderings of incoming events (signals, message calls) Sequence diagrams represent interaction scenarios Reactive statecharts model the behaviour of components
2
Components and Interfaces > User2Phone on() off() dial(n:Digit) > Line2Phone call() reply() disconnect() > Phone > Phone2Line send_on() send_off() send_no(Digit[]) Interfaces implemented by Phone Interface used by Phone and implemented by Line > Line >
3
Protocol Statechart Interface User2Phone Describes sequences of events accepted by the interface IdleDialing or Talking on() off() Talking off() on() > User2Phone on() off() dial(n:Digit) dial(n)
4
Protocol Statechart Interface Phone2Line Describes sequences of events expected by interface IdleTalking send_no(n) send_off() Called send_off() send_on() > Phone2Line send_on() send_off() send_no(Digit[])
5
Protocol Statechart Component Phone Dial Tone on() Idle TalkingRing ToneDialing reply() dial(x) Calling on() off() dial(x) Ringing call() Talking on() off() Called Waiting disconnect() Describes sequences of events expected by component.
6
Reactive Statechart Component Phone Dial Tone on() / send_no(no) Idle TalkingRing ToneDialing reply() dial(x) / no=no+x Calling on() / Digit[] no=“” off() / send_off() Ringing call() Talking Called Waiting disconnect() dial(x) / no=no+x off() / send_off() on() / send_on() Describes reactive behaviour of component.
7
Sequence Diagram Calling Scenario on() reply() off() > :Phone > :Line send_no("14“) dial(1) dial(4) on() send_off("14“) :Actor
8
Protocol Statechart with in-out balance Cf. Ex. M3.2 (a) bal: in degree – out degree bal = 1bal = -1 on() off() bal = 0 off() on() > User2Phone on() off() dial(n:Digit) dial(n)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.