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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights 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
DOI: https://doi.org/10.1007/978-1-4302-0496-1_17
Publisher Name: Apress
Print ISBN: 978-1-59059-908-2
Online ISBN: 978-1-4302-0496-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books