码迷,mamicode.com
首页 > 其他好文 > 详细

Builder pattern - best understanding

时间:2015-07-14 13:42:26      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:design-pattern

Suitable environment.
1.Creation of complex object and don’t want to know how it is assembled (need encapsulation of creation process)
2.For same object ,it have more than one construction representation.

E.g
House buyer(Client),Construction company(Director),worker

Why suitable for construction pattern?

1.Client tell construction company wants 2 windows house or Jeff House which have two window.—>2.For same object ,it have more than one construction representation.
2.Client don’t want to know how it is built.—–>1.encapsulation

技术分享

PS.
GOF explain this pattern very well.

版权声明:本文为博主原创文章,未经博主允许不得转载。

Builder pattern - best understanding

标签:design-pattern

原文地址:http://blog.csdn.net/chungchi300/article/details/46875745

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!