Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering JavaScript Design Patterns

You're reading from   Mastering JavaScript Design Patterns Discover how to use JavaScript design patterns to create powerful applications with reliable and maintainable code

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783987986
Length 290 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Simon Timms Simon Timms
Author Profile Icon Simon Timms
Simon Timms
Arrow right icon
View More author details
Toc

Chapter 5. Behavioral Patterns

In the last chapter, we looked at structural patterns that describe ways in which objects can be constructed to ease interaction.

In this chapter, we'll take a look at the final, and largest, grouping of GoF patterns: behavioral patterns. These patterns are the ones that provide guidance on how objects share data, or from a different perspective, how data flows between objects.

The patterns we'll look at are:

  • Chain of responsibility
  • Command
  • Interpreter
  • Iterator
  • Mediator
  • Memento
  • Observer
  • State
  • Strategy
  • Template method
  • Visitor

Once again, there are a number of more recently identified patterns that could well be classified as behavioral patterns. We'll defer looking at those until a later chapter, instead keeping to the GoF patterns.

Chain of responsibility

We can think of a function call on an object as sending that object a message. Indeed this message-passing mentality was one that dates back to the days of Smalltalk. The chain of responsibility...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime