新手提问~谢谢解答
在builder模式里面,如果我只用到一个concreteBuilder,那么我还需要使用builder模式吗?
我要建的对象是个复杂的对象,需要一步一步来创建,但是对象的种类就一种,那么interface Builder不就是凭空多了一层?
在gof里提到什么时候用这个模式:
Where to use
•When the algorithm for creating a complex object should be independent of
the parts that make up the object and how they are assembled.
•When the construction process must allow different representations for the
object that is constructed.
•When you want to insulate clients from the knowledge of the actual
creation process and/or resulting product.
如果要用这个模式,是要满足全部3点吗?如果我只满足第一点呢?
刚开始学习模式,没什么经验,谢谢解答
[该贴被admin于2009-03-21 13:45修改过]