IV. FACTORY METHOD PATTERN AND ABSTRACT
FACTORY PATTERN
1. Factory Method Pattern
A. Definition
The Factory Method Pattern defines an interface for
creating an object, but lets subclasses decide which class to
instantiate. Factory Method lets a class defer instantiation to
subclasses.
B. Decription
As with every factory, the Factory Method Pattern gives
us a way to encapsulate the instantiations of concrete types.
Looking at the class diagram below, we can see that the
abstract Creator gives us an interface with a method for
creating objects, also known as the