Chapter 25: The Command Pattern
In this chapter, we will cover the command pattern. Using this design pattern, we can encapsulate an operation, such as copy and paste, as an object. The command pattern is also great for grouping multiple commands. It's useful for implementing macros, multilevel undoing, and transactions. Throughout our discussions, we will learn about the idea of treating an operation as an object and use this command mindset to handle application transactions.
We will discuss the following:
- Understanding the command pattern
- Real-world examples
- Use cases
- Implementation