Skip to main content

The Chain of Responsibility Pattern

  • Chapter
Pro JavaScript Design Patterns
  • 1834 Accesses

Abstract

In this chapter, we look at the chain of responsibility, which allows you to decouple the sender and the receiver of a request. This is accomplished by implementing a chain of objects that implicitly handles the request. Each object in the chain can handle the request or pass it on to the next object. This pattern is used internally in JavaScript to handle event capturing and bubbling. We explore how to use this pattern to create more loosely coupled modules and to optimize event attachment.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Ross Harmes and Dustin Diaz

About this chapter

Cite this chapter

(2008). The Chain of Responsibility Pattern. In: Pro JavaScript Design Patterns. Apress. https://doi.org/10.1007/978-1-4302-0496-1_17

Download citation

Publish with us

Policies and ethics