Abstract Factory mode can be simply understood as an abstraction of the factory pattern, which is a common and abstract product of multiple factory that defines the unified interface for objects created by factory method. Concreteproduct a specific class to implement the product interface. Creator is generally an abstract class that declares several FactoryMethod (methods) that create objects of type product. Because it can "produce" objects, it is called FactoryMethod. Creator may also have a method to create a default specific object. Concretecreator overloads factory method to create a specific instance of a concreteproduct. Each subclass of an abstract class is a factory that can build products of different requirements, such as the BMW factory and the Mercedes-Benz plant.
In the abstract factory model, each concretecreator only produces a specific product, such as BMW's production workshop, only the production of BMW, but not the production of Mercedes-Benz cars, the same Mercedes-Benz production plant can only produce Mercedes-Benz cars and not the production of BMW cars, Both the BMW and Mercedes-Benz production plants use the same tectonic model, that is, they are inherited to achieve the creator, for product, I just know the need for a Mercedes, but do not care about the car in which workshop production. 2009-12-27
The difference between the Factory pattern and the abstract Factory pattern can be compared with the two production plants of BMW and Mercedes. In factory pattern, the user as long as I request from the Mercedes-Benz Workshop or BMW workshop to provide a product, that is, the product type has been specified in the user. In the abstract Factory pattern, the user does not specify that the product I want is coming out of a BMW or Mercedes-Benz workshop.
Application Example: A font in a PDF file that displays the specified font if the specified font type exists, otherwise the system default font is called. 2012-3-13