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 is abstract 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 is builder. 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 is prototype.
阅读(736) | 评论(0) | 转发(0) |