http://blog.jobbole.com/78067/
This example is very good, very clear.
The difficulty of feeling abstract Factory mode is how to classify, for example, a scene, or a strange one, now has a sword manufacturing plant and a knife manufacturing plant, respectively, can create a wooden and iron weapons,
So, is the classification abstract by Muhe as standard, or with swords and knives as abstractions?
Http://design-patterns.readthedocs.org/zh_CN/latest/creational_patterns/abstract_factory.html The article says: Understand the following things before you know the abstract factory
- Product Hierarchy Structure : Product hierarchy structure is the product's inheritance structure, such as an abstract class is a television, its sub-category has Haier TV, Hisense TV, TCL TV, then the abstract TV and the specific brand of television constitute a product hierarchy structure, abstract TV is the parent class, and the specific brand of television is its sub-category.
- Product Family : In the abstract factory model, product family refers to a group of products produced by the same factory, located in different product grade structure, such as Haier TV Haier electric factory production, Haier Refrigerator, Haier TV set in the TV product hierarchy, Haier Refrigerator is located in the refrigerator product grade structure.
Abstract Factory mode