Creating objects is a messy business. So, many object-oriented designs deal with nice, clean abstract classes, taking advantage of the impressive flexibility afforded by polymorphism (the switching of concrete implementations at runtime). To achieve this flexibility, though, I must devise strategies for object generation. This is the topic I will look at in this chapter.
The Singleton pattern: A special class that generates one—and only one—object instance
The Factory Method pattern: Building an inheritance hierarchy of creator classes