Working With Design Patterns: State
Working With Design Patterns: State
Conditional logic is essential to building any application, yet too much can make an application incomprehensible. Many of the applications I build require that an object exist in many different states, with behavior differing from state to state. A straightforward implementation involves lots of if statements and complex conditionals, producing overly convoluted solutions in short order. As a remedy, I use the state design pattern to keep my code from getting out of hand.
Read More:
http://www.developer.com/design/article.php/3753906
Thanks