The intent of Abstract Factory is to provide for the creation of a family of related, or dependent, objects. see pic:

Additional note is below:( reference from http://www.dofactory.com) :
- AbstractFactory (ContinentFactory)
- declares an interface for operations that create abstract products
- ConcreteFactory (AfricaFactory, AmericaFactory)
- implements the operations to create concrete product objects
- AbstractProduct (Herbivore, Carnivore)
- declares an interface for a type of product object
- Product (Wildebeest, Lion, Bison, Wolf)
- defines a product object to be created by the corresponding concrete factory
- implements the AbstractProduct interface
- Client (AnimalWorld)
- uses interfaces declared by AbstractFactory and AbstractProduct classes
using the term: 产品族(Product Family),the former pic is like:

In this pattern, speaking loosely, a package is usually a "family" of classes, and an abstract factory produces a "family" of objects.
本文详细介绍了抽象工厂模式的概念及其组成部分,包括抽象工厂、具体工厂、抽象产品和具体产品等,并通过示例说明了如何使用这一设计模式来创建一系列相关或相互依赖的对象。
753

被折叠的 条评论
为什么被折叠?



