Chapter 24: The Chain of Responsibility Pattern
We now cover the Chain of Responsibility design pattern, which should be used, as we will see, when we do not know the number and type of requests/events we would need to support. While this may seem vague, this pattern is useful among a wide range of use cases, such as event-based systems, purchase systems, and shipping systems.
In this chapter, we will learn what the Chain of Responsibility pattern is, its benefits, and—as always—how to implement it in a practical Python example. We will discuss the following topics:
- Understanding the Chain of Responsibility pattern
- Real-world examples
- Use cases
- Implementation
Technical requirements
The code files for this chapter can be accessed through this ...
Get Advanced Python Programming - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.