Mastering JavaScript Design Patterns

Discover how to use JavaScript design patterns to create powerful applications with reliable and maintainable code
Preview in Mapt

Mastering JavaScript Design Patterns

Simon Timms

1 customer reviews
Discover how to use JavaScript design patterns to create powerful applications with reliable and maintainable code
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.90
RRP $26.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.90
$44.99
$29.99p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering JavaScript Design Patterns Book Cover
Mastering JavaScript Design Patterns
$ 26.99
$ 18.90
Mastering JavaScript Design Patterns: A Practical Introduction to Building Better Applications [Video] Book Cover
Mastering JavaScript Design Patterns: A Practical Introduction to Building Better Applications [Video]
$ 94.99
$ 80.75
Buy 2 for $35.00
Save $86.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781783987986
Paperback290 pages

Book Description

Applying design patterns to JavaScript code creates more reliable and maintainable code. In this book, you will explore different design patterns and learn where and how to implement them with the help of detailed examples.

In the first part of the book, we start off with an introduction to design patterns, and then move on to creating classical structures that are used to organize code. Next, we look at the creational, structural, and behavioral patterns. The second part of the book dives into patterns used for functional programming, model view patterns, patterns to build web applications, and messaging patterns. A number of very interesting advanced JavaScript patterns such as dependency injection and live postprocessing are also covered.

By the end of this book, you will learn to identify places where a pattern would improve code readability and maintainability.

Table of Contents

Chapter 1: Designing for Fun and Profit
The road to JavaScript
What is a design pattern?
Antipatterns
Summary
Chapter 2: Organizing Code
Chunks of code
What's the matter with global scope anyway?
Objects in JavaScript
Build me a prototype
Inheritance
Modules
ECMAScript 6 classes and modules
Best practices and troubleshooting
Summary
Chapter 3: Creational Patterns
Abstract Factory
Implementation
Builder
Factory Method
Singleton
Prototype
Hints and tips
Summary
Chapter 4: Structural Patterns
Adapter
Bridge
Composite
Decorator
Façade
Flyweight
Proxy
Hints and tips
Summary
Chapter 5: Behavioral Patterns
Chain of responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer
State
Strategy
Template method
Visitor
Hints and tips
Summary
Chapter 6: Functional Programming
Functional functions are side-effect free
Function passing
Filters and pipes
Accumulators
Memoization
Immutability
Lazy instantiation
Hints and tips
Summary
Chapter 7: Model View Patterns
First, some history
Model View Controller
Model View Presenter
Model View ViewModel
Hints and tips
Summary
Chapter 8: Web Patterns
Sending JavaScript
Plugins
Doing two things at once – multithreading
The circuit breaker pattern
The promise pattern
Hints and tips
Summary
Chapter 9: Messaging Patterns
What's a message anyway?
Request-reply
Publish-subscribe
Dead-letter queues
Hints and tips
Summary
Chapter 10: Patterns for Testing
The testing pyramid
Test in the small with unit tests
Arrange-Act-Assert
Fake objects
Monkey patching
Interacting with the user interface
Build and test tools
Hints and tips
Summary
Chapter 11: Advanced Patterns
Dependency injection
Live postprocessing
Aspect-oriented programming
Macros
Hints and tips
Summary
Chapter 12: ES6 Solutions Today
TypeScript
Traceur
Hints and tips
Summary

What You Will Learn

  • Organize your code with classes and modules
  • Explore the original Gang of Four patterns and learn how to apply them to JavaScript
  • Decrease the degree of coupling in applications and increase code reuse through creational patterns
  • Rethink your coding through the use of functional patterns
  • Master advanced JavaScript patterns such as dependency injection and live postprocessing
  • Improve the testability of your code with mock objects, mocking frameworks, and monkey patching
  • Discover the patterns that are the basis of modern JavaScript libraries such as Knockout.js, Angular.js, and Backbone.js

Authors

Table of Contents

Chapter 1: Designing for Fun and Profit
The road to JavaScript
What is a design pattern?
Antipatterns
Summary
Chapter 2: Organizing Code
Chunks of code
What's the matter with global scope anyway?
Objects in JavaScript
Build me a prototype
Inheritance
Modules
ECMAScript 6 classes and modules
Best practices and troubleshooting
Summary
Chapter 3: Creational Patterns
Abstract Factory
Implementation
Builder
Factory Method
Singleton
Prototype
Hints and tips
Summary
Chapter 4: Structural Patterns
Adapter
Bridge
Composite
Decorator
Façade
Flyweight
Proxy
Hints and tips
Summary
Chapter 5: Behavioral Patterns
Chain of responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer
State
Strategy
Template method
Visitor
Hints and tips
Summary
Chapter 6: Functional Programming
Functional functions are side-effect free
Function passing
Filters and pipes
Accumulators
Memoization
Immutability
Lazy instantiation
Hints and tips
Summary
Chapter 7: Model View Patterns
First, some history
Model View Controller
Model View Presenter
Model View ViewModel
Hints and tips
Summary
Chapter 8: Web Patterns
Sending JavaScript
Plugins
Doing two things at once – multithreading
The circuit breaker pattern
The promise pattern
Hints and tips
Summary
Chapter 9: Messaging Patterns
What's a message anyway?
Request-reply
Publish-subscribe
Dead-letter queues
Hints and tips
Summary
Chapter 10: Patterns for Testing
The testing pyramid
Test in the small with unit tests
Arrange-Act-Assert
Fake objects
Monkey patching
Interacting with the user interface
Build and test tools
Hints and tips
Summary
Chapter 11: Advanced Patterns
Dependency injection
Live postprocessing
Aspect-oriented programming
Macros
Hints and tips
Summary
Chapter 12: ES6 Solutions Today
TypeScript
Traceur
Hints and tips
Summary

Book Details

ISBN 139781783987986
Paperback290 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
AngularJS Web Application Development Blueprints Book Cover
AngularJS Web Application Development Blueprints
$ 29.99
$ 21.00
MEAN Web Development Book Cover
MEAN Web Development
$ 29.99
$ 3.00
Mastering Node.js Book Cover
Mastering Node.js
$ 29.99
$ 6.00