May 2022
Intermediate to advanced
678 pages
11h 48m
English
This chapter covers the Factory Method pattern. The Factory Method pattern will make more sense to you if you understand the pros and cons of the Simple Factory pattern, which is covered in Chapter 2.
It defines an interface for creating an object, but lets subclasses decide which class to instantiate. The Factory Method pattern lets a class defer instantiation to subclasses.
Here you start with an abstract creator class (often called a creator) that defines the basic structure of an application, ...