April 2004
Intermediate to advanced
480 pages
8h 29m
English
There will be times when you want to provide for object creation while retaining control of which class to instantiate. In such circumstances, you can apply the FACTORY METHOD pattern with a method that uses an outside factor to determine which class to instantiate. Sometimes the factor that controls which object to instantiate can be thematic, running across several classes. The ABSTRACT FACTORY pattern addresses this situation. Its intent is to provide for the creation of families of related or dependent objects.
GUI kits provide a classic example of the ABSTRACT FACTORY pattern. A GUI kit is an object that is an abstract factory, supplying GUI controls to a client that is building a user ...
Read now
Unlock full access