Applying the Factory Pattern
This chapter will continue our pursuit to expand your C++ programming repertoire beyond core OOP concepts, with the goal of enabling you to solve recurring types of coding problems utilizing common design patterns. We know that incorporating design patterns can enhance code maintenance and provide avenues for potential code reuse.
Continuing to demonstrate and explain popular design patterns and idioms and learning how to implement them effectively in C++, we continue our quest with the Factory pattern, more precisely known as the Factory Method pattern.
In this chapter, we will cover the following main topics:
- Understanding the Factory Method pattern and how it contributes to OOP
- Understanding how to implement the Factory Method pattern with and without an Object Factory, and comparing an Object Factory to an Abstract Factory
By the end of this chapter, you will understand the popular Factory Method pattern. We will see two example...