State-based Design Flashcards

1
Q

What is meant by a state-based system?

A

reactive system that behaves differently to evetns depending on what state its in

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do we describe a reacitve system?

A
  • Events; requests handled by system
  • Actions; performed in repsonse to events
  • States; affect how system responds
  • Transitions; routes that exit/enter states
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by the alphabet of a state machine?

A
  • Set of all events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is meant by “Completing a Machine”?

A

Add in to a state machine diagram all missing transitions from the alphabet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What can be specified by a state machine?

A

Can capture different levels of abstraction: high level control and low level behaviour

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is contained in a UML Frame label?

A

frame type code

name of UML element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between a Behavioural State MAchine and a Protocol State MAchine?

A

Behavioural:

  • illustrates reactive behaviour
  • shows how different ations are triggered by events
  • missing transitions are ignored events

Protocol:

  • illustrate protocol of class/interface
  • shows allowed sequence of messages
  • missing transitions are disallowed messages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why is nondeterminism an issue? WHat is a fix?

A

Means to next state is unknown, could choose arbitrary transition out of options

Use preconditions; add guards to each conflicting tranisition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are events presented to a UML state machine?

A

one at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are transitions enabled in a UML state machine?

A
  • transitions exiting active state are enabled if event trigger matches the event
  • once enabled the transition is then fired, event is consumed and a new event is presented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is meant by “Run-to-Completion” when refering to state machine semantics?

A

All triggered events must be processed before the triggering event is considered finished

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the 2 methods of composing state machines?

A
  • have substate machine inside a superstate

- concurrent state machines; 2 independent state machines inside a state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

With nested UML state machines, which transitions take precedence if there is a name coflict? substate or superstate

A

Substate; to do with inheritance & overriding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where do we enter/exit a substate?

A

Enter at default initial state

Can exit from any/all active substates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can a child subclass be compatible with its parent superclass?

A
  • must exist in same states as parent
  • must repsond to same transitions as parent
  • new states must be substates of parent states
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between a state diagram and an activity diagram?

A

State: all activity happens on transitions
states are quiescent (nothing happens in states)

Activity: all activity happens in nodes
flows represent transfer of control