In Object-Oriented Programming (OOP), everything starts with an object, and if we want to use one, we have to create it first. In most cases, that simply means calling TSomeClass.Create, but in a more complex scenario, a specialized design pattern that creates an object for us can be quite handy.
In this chapter, we'll look into four patterns from the creational group. At the end of the chapter, you'll know the following:
- A singleton pattern, which makes sure that a class has only one instance
- A dependency injection pattern, which makes program architecture more flexible and suitable for test-driven development
- A lazy initialization pattern, which makes sure that we don't spend time and resources creating objects that we don't really need
- An object pool pattern, which speeds up the creation...