Builder pattern - best understanding

来源:互联网 发布:免费的婚恋软件 编辑:程序博客网 时间:2024/06/05 06:25

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 representation for same construction.

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.

0 0
原创粉丝点击