Review Question
1. What is a state?
The state of a program is defined as its condition regarding stored inputs.
The term "state" here is used similarly to how it is used in science —
whereas the state of an object, for instance, as a gas, liquid or solid, shows
its current physical makeup, the state of a computer program shows its
current values or contents.
2.How long can a state last?
We can say that each and every class has a state but we don’t model
every class using State diagrams. We prefer to model the states with three or
more states.
3. How do events affect states?
That may be significant to the behavior of the objects in a class. Events can
have associated arguments
4.What types of entity can a state machine model?
Structural Diagrams
Behavioral Diagrams
5.Can you have a triggerless transition out of a
state?
In particular, state machines must be used to model the behavior of active
classes that use call events and signal events to implement their operations (as
transitions in the class's state machine).
6.What are the four types of actions on a state?
Events
States
Process
Diagrams
7.What is composite state?
A composite state is a state that contains one or more other substates. It
can be used to group states into logical compounds and thus make the statechart
more comprehensible. When a composite state is entered, its entry node denotes
the substate to be activated.
8.What is the syntax for an action?
The syntax of a computer language is the set of rules that defines the
combinations of symbols that are considered to be correctly
structured statements or expressions in that language.
9.What is the syntax for the action-label for an
event?
This event doesn't apply to a label attached to another control, such as the
label for a text box. It applies only to "freestanding" labels.
10.How do you depict composite states?
Composite States can be further broken down into substates (either within
the state or in a separate diagram).
11.What are concurrent substates?
Concurrent substates allow us to specify two or more state machines that
execute in parallel in the context of the enclosing object.
12.What are forks and joins?
In fork, we use a rounded solid rectangular bar to represent a Fork
notation with incoming arrow from the parent state and outgoing
arrows towards the newly created states. We use the fork notation
to represent a state splitting into two or more concurrent states. In joins, we use a
rounded solid rectangular bar to represent a Join
notation with incoming arrows from the joining states and outgoing
arrow towards the common goal state. We use the join notation
when two or more states concurrently converge into one on the
occurrence of an event or events.
13.When a transition is direct to the boundary of a
composite state, what happens?
We use a solid arrow to represent the transition or
change of control from one state to another. The arrow is labelled
with the event which causes the change in state.
14. When a transition is to a substate of a
composite state, what happens?
We use a rounded rectangle to represent a
composite state also.We represent a state with internal activities
using a composite state.
15.What are choice and junction pseudostates?
A choice has several outgoing transitions that each have a condition. In
contrast to junctions, the conditions of a choice can be evaluated on the basis of
values that are determined only at the time of the state transition. Junction
pseudostates are used to design complex transitional paths in State Machine
diagrams. A Junction can be used to combine or merge multiple paths into a
shared transition path.