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
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
The Staff Engineer's Path
For years, companies have rewarded their most effective engineers with management positions. But treating management as …
book
Building Microservices, 2nd Edition
As organizations shift from monolithic applications to smaller, self-contained microservices, distributed systems have become more fine-grained. …
book
A Guide to the Project Management Body of Knowledge (PMBOK® Guide) – Seventh Edition and The Standard for Project Management (ENGLISH)
PMBOK® Guide is the go-to resource for project management practitioners. The project management profession has significantly …