OO State Transition Diagrams (PPT 18) Flashcards

1
Q

What is a state?

A

A condition or situation in the life of an object during which it satisfies some condition, performs some activity or waits for some event

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

How can we find out a state of an object?

A

We can sometimes do this by looking at the value of an objects attributes

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

When can an object change state?

A

It can only change state when an event occurs

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

What are State Transitions?

A

They show movement from one state to another as a result of an event. Represented by direct lines between states, with the event that causes the change written as the name

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

What are the three types of event?

A

Call or signal event
-The receipt of a message from one object in the system

Change event
-A condition becomes true within the object

Time event
-An amount of time has elapsed

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

What is a State Transition Diagram?

A

A diagram that captures the lifecycle of an object

  • States the object can assume
  • Events/messages it can receive
  • Response to events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many state diagrams should you have?

A

In theory, one for each object but in reality, just model those with interesting states

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

What are some other state diagram notations?

A

Reflexive notation
-Transitions may lead to the same state they started in

Conditions
-Specify conditions under which transition will take place or not

Actions
-What an object does in response to an event, shown as part of the transition

Activities
-Show the activity which an object performs for the duration of a certain state

Initial/Final States

  • Initial state shows starting point of life cycle (circle)
  • Final state shows end of life cycle (Circle with circle around it)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between Activities vs Actions?

A

Activities are ongoing while a state exists and can be interrupted by other events.

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