At the moment, the Knit operation is governed by multiple state variables that control program flow in procedures such as knit(). These variables include the following members of class OpKnit:
The imperative code works fine but if we want to pursue a more OO programming style it is possible to abstract some or all of these into a sequence of operations governed by the finite state machine.
My suggestion is to leave things as they are for now, but think about making changes if we want to do #105 which will add further complexity to the program flow.
At the moment, the
Knit
operation is governed by multiple state variables that control program flow in procedures such asknit()
. These variables include the following members of classOpKnit
:plus
(m_sOldPosition == position)
and so on.The imperative code works fine but if we want to pursue a more OO programming style it is possible to abstract some or all of these into a sequence of operations governed by the finite state machine.
My suggestion is to leave things as they are for now, but think about making changes if we want to do #105 which will add further complexity to the program flow.