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

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.

主站蜘蛛池模板: 新宁县| 梧州市| 阿克| 龙州县| 汉寿县| 阿克陶县| 庆阳市| 岳阳市| 韩城市| 潍坊市| 报价| 定结县| 襄城县| 彰武县| 铜梁县| 明光市| 白玉县| 文水县| 西充县| 黑龙江省| 永仁县| 海门市| 湘潭市| 剑阁县| 大城县| 罗源县| 南岸区| 商南县| 南开区| 宁波市| 玛纳斯县| 会宁县| 芮城县| 纳雍县| 临泽县| 陆河县| 固始县| 古丈县| 鲁山县| 长宁区| 榆社县|