What's the revised builder pattern?

后端 未结 2 1064
半阙折子戏
半阙折子戏 2020-12-29 08:29

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

2条回答
  •  独厮守ぢ
    2020-12-29 08:58

    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.

提交回复
热议问题