7) State Machine and Timing Diagram
7) State Machine and Timing Diagram
Understand State Machine diagram with the help of an example, ie for an online order :
The UML diagrams we draw depend on the system we aim to represent. Here is
just an example of how an online ordering system might look like :
1. On the event of an order being received, we transit from our initial state to
Unprocessed order state.
2. The unprocessed order is then checked.
3. If the order is rejected, we transit to the Rejected Order state.
4. If the order is accepted and we have the items available we transit to the fulfilled
order state.
5. However if the items are not available we transit to the Pending Order state.
6. After the order is fulfilled, we transit to the final state. In this example, we merge the
two states i.e. Fulfilled order and Rejected order into one final state.
Program Name: B.Tech CSE-AIML/AIML Program Code:
Department of Computer Science & Engineering (AIML)
Course Code : BCS 054 Course Name: OOSD with C++
• ref,. …
• https://www.uml-diagrams.org/
Timing Diagram
• Lifeline
• As the name suggests, the lifeline portrays an
individual element in the interaction. It represents
a single entity, which is a part of the interaction. It
is represented by the classifier's name that it
depicts. A lifeline can be placed within a
"swimlane" or a diagram frame.
• States or conditions
Duration Constraint
• The duration constraint is a constraint of an interval,
which refers to duration interval. It is used to determine
if the constraint is satisfied for a duration or not. The
duration constraint semantics inherits from the
constraints.
• The negative trace defines the violated constraints,
which means the system is failed. A graphical
association between duration interval and the construct,
which it constrains, may represent a duration constraint.
Program Name: B.Tech CSE-AIML/AIML Program Code:
Department of Computer Science & Engineering (AIML)
Course Code : BCS 054 Course Name: OOSD with C++
• Draw timing diagram for Water (H2O ) where ice should melt
into water in 1 to 6 minutes?
• Time Constraint
• It is an interval constraint, which refers to the time
interval. Since it is a time expression, it depicts if
the constraint is satisfied or not. The constraints
dispense its time constraints semantics.
The graphical association is mainly represented by a small line in between a time
interval and an occurrence specification.
• Examples
• In a Unified Modeling Language (UML) diagram, the namespace type "sd" is used
for timing diagrams, communication diagrams, and interaction overview
diagrams. The "sd" is used for historical reasons, even though the namespace type is
an interaction in the diagram header.