您的位置:首页 > 其它

design pattern notes [3] - factory

2012-12-13 09:54 411 查看
Factory method is virtual method to create local-specific object in the class hierarchy. The base class may or not implement it.

If a parameter is passed to create method to create product by calling its virtual methods.this isabstract factory. The client can get all components from abstract factory to assembly one product. The procedure is visible
to client.

If a parameter is passed to create method to create product in its entirely. This isbuilder. The client does not need to get any component from builder to assembly product. All components are inside of builder. Once done,
the client gets the final product.

If all components are passed as parameters to create method to build final product by copying these component. This isprototype.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: