March 2002
Intermediate to advanced
496 pages
8h 51m
English
Suppose that you decide to move the state constants to a DoorConstants interface. For this approach to work, you have to eliminate the Door instance variable from the DoorState class. You can drop this variable by changing the click(), complete(), and timeout() transition methods in the DoorState class to require a Door object as an input parameter. In this design, a Door object that receives, for example, a click() method from the carousel forwards this call as state.click(this).
|
Read now
Unlock full access