One technique for coping with the complexity of state-specific behavior is the state design pattern.
This pattern uses the concept of delegation to separate the implementation of a behavior from the object that is responsible for the behavior.
For example, most of us are responsible for filing taxes. However, for some of us, the process is extremely complex and requires
assistance from an expert. We retain ultimate responsibility for filing the taxes, but we delegate the actual process to a
specialist who does it for us. When the tax specialist is finished, he/she returns the results to us. Click the View Image button to see the key components of the state design pattern.