Summary

In this chapter we've looked at a bunch of behavioral patterns. Some of these patterns such as observer and iterator will be ones you'll use almost every day, while others such as interpreter you might use no more than a handful of times in your entire career. Learning about these patterns should help you identify well-defined solutions to common problems.

Most of the patterns are directly applicable to JavaScript and some of them, such as the strategy pattern, become more powerful in a dynamic language. The only pattern we found that has some limitations is the visitor pattern. The lack of static classes and polymorphism makes this pattern difficult to implement without breaking proper separation of concerns.

These aren't, by any means, all of the behavioral patterns in existence. The programming community has spent the past two decades building on the ideas of the GoF book and identifying new patterns. The remainder of this book is dedicated to these newly identified patterns. The solutions may be very old ones but not generally recognized as common solutions until more recently. As far as I'm concerned this is the point where the book starts to get very interesting as we start looking at less well known and more JavaScript-specific patterns.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset