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: August 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449331818
You might also like
book
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Software Engineering at Google
Today, software engineers need to know not only how to program effectively but also how to …
book
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …
book
Fundamentals of Software Architecture
Salary surveys worldwide regularly place software architect in the top 10 best jobs, yet no real …