An edition of Learning JavaScript Design Pattern (2012)

Learning JavaScript Design Pattern

A JavaScript and jQuery Developer's Guide

  • 5.0 (1 rating)
  • 6 Want to read
  • 1 Have read
Locate

My Reading Lists:

Create a new list

  • 5.0 (1 rating)
  • 6 Want to read
  • 1 Have read

Buy this book

Last edited by Drini
September 14, 2025 | History
An edition of Learning JavaScript Design Pattern (2012)

Learning JavaScript Design Pattern

A JavaScript and jQuery Developer's Guide

  • 5.0 (1 rating)
  • 6 Want to read
  • 1 Have read

This edition doesn't have a description yet. Can you add one?

Publish Date
Publisher
O'Reilly Media
Pages
254

Buy this book

Edition Availability
Cover of: Learning JavaScript Design Patterns
Learning JavaScript Design Patterns: A JavaScript and React Developer's Guide
2023, O'Reilly Media, Incorporated, O'Reilly Media
in English
Cover of: Learning JavaScript Design Patterns
Learning JavaScript Design Patterns
2012, O'Reilly Media, Incorporated
in English
Cover of: Learning JavaScript Design Pattern
Learning JavaScript Design Pattern: A JavaScript and jQuery Developer's Guide
August 27, 2012, O'Reilly Media
Cover of: Learning JavaScript Design Patterns
Learning JavaScript Design Patterns
2012, O'Reilly Media, Incorporated
in English

Add another edition?

Book Details


Table of Contents

Preface
Page ix
1. Introduction
Page 1
2. What Is a Pattern?
Page 3
We Already Use Patterns Every Day
Page 4
3. "Pattern"-ity Testing, Proto-Patterns, and the Rule of Three
Page 7
4. The Structure of a Design Pattern
Page 9
5. Writing Design Patterns
Page 11
6. Anti-Patterns
Page 13
7. Categories of Design Patterns
Page 15
Creational Design Patterns
Page 15
Structural Design Patterns
Page 16
Behavioral Design Patterns
Page 16
8. Design Pattern Categorization
Page 17
A Brief Note on Classes
Page 17
9. JavaScript Design Patterns
Page 21
The Constructor Pattern
Page 22
Object Creation
Page 22
Basic Constructors
Page 24
Constructors with Prototypes
Page 25
The Module Pattern
Page 26
Object Literals
Page 26
Module Pattern
Page 27
Module Pattern Variations
Page 32
The Revealing Module Pattern
Page 37
Advantages
Page 38
Disadvantages
Page 38
The Singleton Pattern
Page 39
The Observer Pattern
Page 42
Differences Between the Observer and Publish/Subscribe Pattern
Page 46
Advantages
Page 48
Disadvantages
Page 49
Publish/Subscribe Implementations
Page 49
The Mediator Pattern
Page 59
Basic Implementation
Page 60
Advanced Implementation
Page 61
Example
Page 66
Advantages and Disadvantages
Page 68
Mediator Versus Observer
Page 68
Mediator Versus Facade
Page 68
The Prototype Pattern
Page 69
The Command Pattern
Page 72
The Facade Pattern
Page 74
Notes on Abstraction
Page 76
The Factory Pattern
Page 77
When to Use the Factory Pattern
Page 80
When Not to Use the Factory Pattern
Page 80
Abstract Factories
Page 80
The Mixin Pattern
Page 81
Subclassing
Page 81
Mixins
Page 83
Advantages and Disadvantages
Page 86
The Decorator Pattern
Page 86
Pseudoclassical Decorators
Page 90
Interfaces
Page 90
Abstract Decorators
Page 91
Decorators with jQuery
Page 94
Advantages and Disadvantages
Page 96
Flyweight
Page 96
Using Flyweights
Page 97
Flyweights and Sharing Data
Page 97
Implementing Classical Flyweights
Page 98
Converting Code to Use the Flyweight Pattern
Page 101
A Basic Factory
Page 103
Managing the Extrinsic States
Page 104
The Flyweight Pattern and the DOM
Page 105
10. JavaScript MV* Patterns
Page 109
MVC
Page 109
Smalltalk-80 MVC
Page 109
MVC for JavaScript Developers
Page 110
Models
Page 111
Views
Page 113
Controllers
Page 115
Controllers in Another Library (Spine.js) Versus Backbone.js
Page 116
What Does MVC Give Us?
Page 118
Smalltalk-80 MVC in JavaScript
Page 118
Delving Deeper
Page 119
Summary
Page 119
MVP
Page 119
Models, Views, and Presenters
Page 120
MVP or MVC?
Page 121
MVC, MVP, and Backbone.js
Page 121
MVVM
Page 123
History
Page 124
Model
Page 125
View
Page 125
ViewModel
Page 128
Recap: The View and the ViewModel
Page 130
Recap: The ViewModel and the Model
Page 130
Pros and Cons
Page 130
Advantages
Page 130
Disadvantages
Page 130
MVVM with Looser Data Bindings
Page 131
MVC Versus MVP Versus MVVM
Page 135
Backbone.js Versus KnockoutJS
Page 136
11. Modern Modular JavaScript Design Patterns
Page 139
A Note on Script Loaders
Page 140
AMD
Page 140
Getting Started with Modules
Page 141
AMD Modules with Dojo
Page 144
AMD Module Design Patterns (Dojo)
Page 145
AMD Modules with jQuery
Page 147
AMD Conclusions
Page 149
CommonJS
Page 150
Getting Started
Page 150
Consuming Multiple Dependencies
Page 151
Loaders and Frameworks That Support CommonJS
Page 151
Is CommonJS Suitable for the Browser?
Page 152
Related Reading
Page 152
AMD and CommonJS: Competing, but Equally Valid Standards
Page 153
Umd: AMD and CommonJS-Compatible Modules for Plug-ins
Page 153
ES Harmony
Page 158
Modules with Imports and Exports
Page 159
Modules Loaded from Remote Sources
Page 160
Module Loader API
Page 160
CommonJS-like Modules for the Server
Page 160
Classes with Constructors, Getters, and Setters
Page 161
ES Harmony Conclusions
Page 162
Related Reading
Page 162
Conclusions
Page 162
12. Design Patterns in jQuery
Page 165
The Composite Pattern
Page 165
The Adapter Pattern
Page 166
The Facade Pattern
Page 168
The Observer Pattern
Page 170
The Iterator Pattern
Page 173
Lazy Initialization
Page 174
The Proxy Pattern
Page 176
The Builder Pattern
Page 177
13. jQuery Plug-in Design Patterns
Page 179
Patterns
Page 180
A Lightweight Start Pattern
Page 181
Complete Widget Factory Pattern
Page 183
Nested Namespacing Plug-in Pattern
Page 185
Custom Events Plug-in Pattern (with the Widget Factory)
Page 187
Prototypal Inheritance with the DOM-to-Object Bridge Pattern
Page 189
jQuery UI Widget Factory Bridge Pattern
Page 191
jQuery Mobile Widgets with the Widget Factory
Page 193
RequireJS and the jQuery UI Widget Factory
Page 196
Usage
Page 198
Globally and Per-Call Overridable Options (Best Options Pattern)
Page 199
A Highly Configurable and Mutable Plug-in Pattern
Page 200
What Makes a Good Plug-in Beyond Patterns?
Page 203
Quality
Page 203
Code Style
Page 203
Compatibility
Page 203
Reliability
Page 203
Performance
Page 204
Documentation
Page 204
Likelihood of Maintenance
Page 204
Conclusions
Page 204
Namespacing Patterns
Page 205
Namespacing Fundamentals
Page 205
Single Global Variables
Page 205
Prefix Namespacing
Page 206
Object Literal Notation
Page 206
Nested Namespacing
Page 210
Immediately Invoked Function Expressions (IIFE)s
Page 211
Namespace Injection
Page 213
Advanced Namespacing Patterns
Page 215
Automating Nested Namespacing
Page 215
Dependency Declaration Pattern
Page 217
Deep Object Extension
Page 218
Recommendation
Page 221
14. Conclusions
Page 223
Appendix: References
Page 225
Index
Page 229

Classifications

Library of Congress
QA76.73.J39 O86 2012, QA76.73.J39O86 2012

Edition Identifiers

Open Library
OL25431314M
ISBN 10
1449331815
ISBN 13
9781449331818
LCCN
2012472506
OCLC/WorldCat
809534163

Work Identifiers

Work ID
OL16807226W

Community Reviews (0)

No community reviews have been submitted for this work.

Lists

Download catalog record: RDF / JSON / OPDS | Wikipedia citation