Saturday, May 12, 2007

Strategy Pattern

Defines a family of algo, encapsulates each one, and makes them interchangeable.

program to interface not to implementation.

eg: Duck
Duck -> FlyBehavior & QuackBehavior
+ fly
+ quack
-setBeh()
-setQua()

real world:
Parser -> Lex

No comments: