Book description
With Learning JavaScript Design Patterns, you’ll learn how to write beautiful, structured, and maintainable JavaScript by applying classical and modern design patterns to the language. If you want to keep your code efficient, more manageable, and up-to-date with the latest best practices, this book is for you.
Explore many popular design patterns, including Modules, Observers, Facades, and Mediators. Learn how modern architectural patterns—such as MVC, MVP, and MVVM—are useful from the perspective of a modern web application developer. This book also walks experienced JavaScript developers through modern module formats, how to namespace code effectively, and other essential topics.
- Learn the structure of design patterns and how they are written
- Understand different pattern categories, including creational, structural, and behavioral
- Walk through more than 20 classical and modern design patterns in JavaScript
- Use several options for writing modular code—including the Module pattern, Asyncronous Module Definition (AMD), and CommonJS
- Discover design patterns implemented in the jQuery library
- Learn popular design patterns for writing maintainable jQuery plug-ins
"This book should be in every JavaScript developer’s hands. It’s the go-to book on JavaScript patterns that will be read and referenced many times in the future."—Andrée Hansson, Lead Front-End Developer, presis!
Publisher resources
Table of contents
- Learning JavaScript Design Patterns
- Preface
- 1. Introduction
- 2. What Is a Pattern?
- 3. âPatternâ-ity Testing, Proto-Patterns, and the Rule of Three
- 4. The Structure of a Design Pattern
- 5. Writing Design Patterns
- 6. Anti-Patterns
- 7. Categories of Design Patterns
- 8. Design Pattern Categorization
-
9. JavaScript Design Patterns
- The Constructor Pattern
- The Module Pattern
- The Revealing Module Pattern
- The Singleton Pattern
- The Observer Pattern
- The Mediator Pattern
- The Prototype Pattern
- The Command Pattern
- The Facade Pattern
- The Factory Pattern
- The Mixin Pattern
- Subclassing
- Mixins
- The Decorator Pattern
- Pseudoclassical Decorators
- Decorators with jQuery
- Advantages and Disadvantages
- Flyweight
- 10. JavaScript MV* Patterns
- 11. Modern Modular JavaScript Design Patterns
- 12. Design Patterns in jQuery
-
13. jQuery Plug-in Design Patterns
- Patterns
- A Lightweight Start Pattern
- Complete Widget Factory Pattern
- Nested Namespacing Plug-in Pattern
- Custom Events Plug-in Pattern (with the Widget Factory)
- Prototypal Inheritance with the DOM-to-Object Bridge Pattern
- jQuery UI Widget Factory Bridge Pattern
- jQuery Mobile Widgets with the Widget Factory
- RequireJS and the jQuery UI Widget Factory
- Globally and Per-Call Overridable Options (Best Options Pattern)
- A Highly Configurable and Mutable Plug-in Pattern
- What Makes a Good Plug-in Beyond Patterns?
- Conclusions
- Namespacing Patterns
- Namespacing Fundamentals
- Advanced Namespacing Patterns
- 14. Conclusions
- A. References
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Learning JavaScript Design Patterns
- Author(s):
- Release date: July 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449334871
You might also like
book
Mastering JavaScript Design Patterns - Second Edition
Write reliable code to create powerful applications by mastering advanced JavaScript design patterns About This Book …
book
JavaScript Patterns
What's the best approach for developing an application with JavaScript? This book helps you answer that …
book
JavaScript : Object-Oriented Programming
Build sophisticated web applications by mastering the art of Object-Oriented Javascript About This Book Learn popular …
book
Clean Code in JavaScript
Get the most out of JavaScript for building web applications through a series of patterns, techniques, …