Input Belt State Machine Design
We have already defined the sequence diagrams for the Helix Router. This article will focus on designing the C++ classes to implement the design defined by the sequence diagrams. We will step through the development process of one of the most complicated classes in the system, the InputConveyorBelt.
The design process is divided into three distinct steps:
- Analyzing the sequence diagrams and defining the state transition diagram
- Refining the state machine definition
- Implementing the class as a state machine
Here is the state machine design derived from the Helix Router Sequence Diagrams we developed earlier:
Refining the State Machine
Based on the above design we have defined a state hierarchy. The states have been classified into Inservice and OutOfService base states.
The source code for the Input Conveyor Belt is based almost completely the sequence diagrams. The Input Conveyor Belt has been modeled as a hierarchical state machine.