|
|
[i]paste from c2 wiki[/i] An AbstractFactory is a class that exists to create instances of another class. Described on page 87 of the DesignPatternsBook.
Typically, if you want to construct instances of a class, where the class is selected at run time, you...
- Create one AbstractFactory class for each existing class (or group of related classes) you wish to create.
- Have a polymorphic "create instance" method on each AbstractFactory class, conforming to a common method signature, used to create instances of the corresponding class.
- Store and pass around instances of the AbstractFactory class to control selection of the class to create.
See also: FactoryMethod, DesignPatterns |
|