官术网_书友最值得收藏!

Simplified builder pattern

In some implementations of the builder pattern, the Director class can be removed. In our class example, the logic it encapsulates is quite simple, so in that case we don't really need a director. In this case, the simplified builder pattern would look like this:

The code that was implemented in the Director class is simply moved to the Client. This change is not recommended when the Builder and Product classes are too complex or when the builder is used to build an object from a stream of data.

主站蜘蛛池模板: 长沙县| 嘉善县| 吕梁市| 合川市| 彭山县| 沧州市| 丹东市| 嵊泗县| 桃园市| 策勒县| 南木林县| 馆陶县| 高雄县| 荃湾区| 双流县| 滨州市| 罗定市| 通河县| 施秉县| 沂水县| 勐海县| 体育| 洪江市| 浦东新区| 曲水县| 左权县| 嘉鱼县| 徐水县| 安陆市| 平塘县| 阿克苏市| 延庆县| 营山县| 久治县| 榆中县| 湖州市| 米易县| 化州市| 赤峰市| 宣城市| 莱芜市|