Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the revised builder pattern?

What is the difference between the original Builder pattern by GoF and the "revised GoF Builder pattern" by Joshua Bloch?

like image 310
maaartinus Avatar asked Feb 01 '11 07:02

maaartinus


1 Answers

The GoF pattern focuses on abstracting the steps of construction so that by varying the builder you can get different results while the "revised builder" is targeting the problem of unnecessary complexity added by multiple constructors. So the GoF pattern is more about abstraction and the revised patter is more about simplicity (IMO).

Look at the examples in http://en.wikipedia.org/wiki/Builder_pattern and http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html and it should be quite clear.

like image 113
Mikko Wilkman Avatar answered Sep 21 '22 16:09

Mikko Wilkman