Introduction to the Strategy design pattern-The CodeGain

added by codegain
10/24/2010 9:06:11 PM

0 Kicks, 47 Views

The Strategy pattern involves separating an algorithm from its host class and putting it in a separate class. When there are multiple strategies available for an algorithm, for a given problem it is always better to separate them in to different objects. If the algorithms are all kept in the one class, the class will be become a big messy conditional statements.