What Design Pattern To Replace 'CurrentStep' Variable
- by Rob P.
Tried to search but didn't know how to phrase it. I've got some code that is essentially...
Private CurMajorStep as Integer = 0
Private CurMinorStep as Integer = 0
Public Sub PerformNextStep()
Select Case iMajorStep
Case 0
ThingOne()
Case 1
ThingTwo()
Case 2
ThingThree()
Case 3
ThingFour()
Case 4
AnythingElse()
Case 5
Finish()
End Select
End Sub
And then, in some of those, the CurMinorStep keeps track of the current state of that particular 'step'.
I hope that all makes sense.
The code is messy and I know it's going to be problematic to maintain. Can someone point me to a clean OO pattern to handle this?