3 ms·
I personally think Statecharts are a more useful construct than sequence diagrams. It encodes complex behaviour that a developer can use as a guide to develop.
by billfruit 3y ago
I personally think Statecharts are a more useful construct than sequence diagrams. It encodes complex behaviour that a developer can use as a guide to develop.
More importantly it gives a good inkling of what behaviour is allowed and what is not allowed.
For example a statechart can encode that a traffic light can only turn green from amber and not from red.
It also has "H" history state which remembers which substate it was last in, when the system entered this composite state, the previous time. This allows to model behaviour that relies upon "memory" or past behaviour which is very common in real systems.