In this recipe, we will learn how to implement the decorator pattern, which provides the ability to extend the functionality of a class without the need for inheritance, which by design is static in nature. This recipe is important because inheritance doesn't support the ability to extend a class at runtime, a problem the decorator pattern addresses.
Extending your objects with the decorator pattern
Getting ready
Before beginning, please ensure that all of the technical requirements are met, including installing Ubuntu 18.04 or higher and running the following in a Terminal window:
> sudo apt-get install build-essential git cmake
This will ensure your operating system has the proper tools to compile and execute the...