
Abstract Factory

效果:
1. Isolates concrete class
2. Makes exchanging product families easy
3. Promotes consistency among products
4. Supporting new kinds of products is difficult
实现:
1. Factories as singletons.
2. Createing the product.The most common way to do this is to define a factory method for each product. If many product families are possible, the concrete factory can be implemented using Prototype pattern.
3. Defining extensible factories. Abstract factory usually defines a different operation for each kind of product it can produce. A more flexible but less safe design is to add a parameter to operations that create objects.

效果:
1. Isolates concrete class
2. Makes exchanging product families easy
3. Promotes consistency among products
4. Supporting new kinds of products is difficult
实现:
1. Factories as singletons.
2. Createing the product.The most common way to do this is to define a factory method for each product. If many product families are possible, the concrete factory can be implemented using Prototype pattern.
3. Defining extensible factories. Abstract factory usually defines a different operation for each kind of product it can produce. A more flexible but less safe design is to add a parameter to operations that create objects.