© Dmitri Nesteruk 2019
Dmitri NesterukDesign Patterns in .NEThttps://doi.org/10.1007/978-1-4842-4366-4_14

14. Chain of Responsibility

Dmitri Nesteruk1 
(1)
St. Petersburg, c.St-Peterburg, Russia
 

Consider the typical example of corporate malpractice, insider trading. Say a particular trader has been caught red-handed trading on inside information. Who is to blame for this? If management didn’t know, it’s the trader. Maybe the trader’s peers were in on it, though, in which case the group manager might be the one responsible. Perhaps the practice is institutional, in which case the CEO would take the blame.1

This is an example of a responsibility chain: You have several different elements of a system that can all process a message one after another. As ...

Get Design Patterns in .NET: Reusable Approaches in C# and F# for Object-Oriented Software Design 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.