Code is Here:
Welcome to my State Design Pattern Tutorial! I explain how the state pattern is used by using it to simulate an ATM machine.
I explain how you come to decide on the different states. I then show you how to design the interface that each state will use. We think about the methods that are needed for every class that implements the interface then.
All the steps are looked at from many directions and the code above will fill in the gaps.