Tuesday, September 25, 2012

Difference between builder and factory pattern?

Difference between builder and factory pattern?

Builder Pattern

Factory Method /Factory Pattern

Object instantiation at compile time
Defer the object instantiation to run time
Object creation in builder pattern is sequential. Means completes step and move to next.
Does not follow any sequence
Builder creates complex objects with constituent parts
Factory will create the objects it was supposed to may be complex may be simple
Director depicts the algorithm to follow. .
No director concept deciding the assembly

No comments:

Post a Comment