# Chain of Responsibility: The Coin Sorter

When every voice command has to pass a night-time check, a someone's-home check and a permission check, one function full of ifs grows with every new check and gets copied for every new device; a Chain of Responsibility makes each check its own link that stops the command or passes it on, so checks can be added, reordered and reused.

![Cheat sheet: Chain of Responsibility: The Coin Sorter](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/fa731ce1b4bd40dcaaa1ce0fd6642f79.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Chain of Responsibility, Code Smell, coupling, OOP
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-chain-of-responsibility-cheat-sheet
