March 2002
Intermediate to advanced
496 pages
8h 51m
English
Sometimes, 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. The outside factor can be anything. In Chapter 16, Factory Method, this factor was the status of an online credit agency. Sometimes, the factor that controls which object to instantiate can be thematic, running across several classes. The ABSTRACT FACTORY pattern addresses this situation. The intent of this pattern is to provide for the creation of a family of related, or dependent, objects.
Read now
Unlock full access