Skip to main content

Chain of Responsibility

  • Chapter
  • First Online:
Design Patterns in Modern C++
  • 4188 Accesses

Abstract

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. But maybe the trader’s peers were in on it, in which case the group manager might be the one responsible. Or perhaps the practice is institutional, in which case it’s the CEO who would take the blame. This is a good example of a Chain of Reponsibility.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Actually, there’s a bit of confusion here. The concept of Command Query Separation (CQS) suggests the separation of operations into commands (which mutate state and yield no value) and queries (which do not mutate anything but yield a value). The GoF does not have a concept of a Query, so we let any encapsulated instruction to a component be called a Command.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Dmitri Nesteruk

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Nesteruk, D. (2018). Chain of Responsibility. In: Design Patterns in Modern C++. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3603-1_13

Download citation

Publish with us

Policies and ethics