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.
本文深入解析了抽象工厂模式的设计理念,介绍了如何通过该模式创建一系列相互关联的对象,并探讨了其在软件开发中的应用实例。
751

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



