In: Computer Science
: In the context of state diagrams in system design, describe what is an event, state, transition and conditions?
A state diagram generally shows the state or behaviour of an object in accordance with some particular actions or we can say external stimuli.
We can visualize it as a journey of an object where it goes from one square box to another square box due to some actions which take place and finally reach the final square box where it reaches its ultimate goal.
These square boxes can be said to be state of the object or State in state diagrams. We have an Initial State and a Final State. Different diagrammatical symbols are also used for the same.
Now as we go from one state to another state in order to reach
our ultimate goal, we do some transitions. These are label by an
arrow symbols
where the pointer points to which next state object will transit
to. These are termed as Transitions.
Events are the happening that makes a transition takes place. Taking a small example of placing an order, suppose you need to make a payment and it is asking whether it will be a chash or a card . So this is an event which is taking place which will take you to another state as soon as you choose either of the given choices.
Actions are the result of events, usually
written above the (Transition arrow). Following the above
small example used in Events, if we say we chose the card payment,
the arrow will show something like card payment confirmed or
payment through card requested. These are termed as actions .
Condition can be explained as a dependency of state and action. Taking example of wompus world(A game where you move up down left right on square saving your self from dangers), the if present at square 1 and you choose to move up then this is termed as Condition which lead you to square above square 1. Conditions are the situations which an object faces while being in those states.
Hope I was able to explain what was needed in a very simple terms. Happy learning.