April 2026
Intermediate
491 pages
18h 4m
English
Origin: Gang of Four—Behavioral Pattern
The chain of responsibility pattern is a behavioral pattern originally from the Gang of Four.
You can use this pattern to separate the creator of a request from the actual executor of the request. The executing objects can be linked to form a chain, and the request is passed along this chain until one object processes the request.
Let’s imagine a software provider has developed a smartphone app to better plan and carry out weekly shopping. Current offers are obtained via integrations with various supermarket chains and compared against a database of recipes. Together with the user’s preferences, this information is used to generate suggestions ...
Read now
Unlock full access