Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Saturday, January 20, 2007

Simple Factory and Factory Method pattern

The Simple Factory pattern is similar to Extract Method refactor rule -- one method deal with the same (creation) logic.
The Fatory Method pattern is similar to polymorphism--A create method implemented by multiple classes.
The secret of pattern is that: some one reinvent the same way to solve
an old problem and give it a fancy name.