Mastering JavaScript Design Patterns - Second Edition

Write reliable code to create powerful applications by mastering advanced JavaScript design patterns
Preview in Mapt

Mastering JavaScript Design Patterns - Second Edition

Simon Timms

1 customer reviews
Write reliable code to create powerful applications by mastering advanced JavaScript design patterns
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $31.99
Save 68%
Print + eBook
$39.99
RRP $39.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
$10.00
$39.99
$29.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering JavaScript Design Patterns - Second Edition Book Cover
Mastering JavaScript Design Patterns - Second Edition
$ 31.99
$ 10.00
Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 10.00
Buy 2 for $20.00
Save $47.98
Add to Cart

Book Details

ISBN 139781785882166
Paperback290 pages

Book Description

With the recent release of ES-2015, there are several new object-oriented features and functions introduced in JavaScript. These new features enhance the capabilities of JavaScript to utilize design patterns and software design methodologies to write powerful code.

Through this book, you will explore how design patterns can help you improve and organize your JavaScript code. You’ll get to grips with creational, structural and behavioral patterns as you discover how to put them to work in different scenarios. Then, you'll get a deeper look at patterns used in functional programming, as well as model view patterns and patterns to build web applications.

This updated edition will also delve into reactive design patterns and microservices as they are a growing phenomenon in the world of web development. You will also find patterns to improve the testability of your code using mock objects, mocking frameworks, and monkey patching. We’ll also show you some advanced patterns including dependency injection and live post processing.

By the end of the book, you'll be saved of a lot of trial and error and developmental headaches, and you will be on the road to becoming a JavaScript expert.

Table of Contents

Chapter 1: Designing for Fun and Profit
The road to JavaScript
What is a design pattern?
Anti-patterns
Summary
Classical Design Patterns
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 2015 classes and modules
Best practices and troubleshooting
Summary
Chapter 3: Creational Patterns
Abstract factory
Builder
Factory method
Singleton
Prototype
Tips and tricks
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: Reactive Programming
Application state changes
Streams
Filtering streams
Merging streams
Streams for multiplexing
Hints and tips
Summary
Chapter 8: Application Patterns
First, some history
Model View Controller
Model View Presenter
Model View ViewModel
Tips and tricks
Summary
Chapter 9: Web Patterns
Sending JavaScript
Plugins
Doing two things at once – multithreading
Circuit breaker pattern
Promise pattern
Hints and tips
Summary
Chapter 10: Messaging Patterns
What's a message anyway?
Request-reply
Publish-subscribe
Dead letter queues
Hints and tips
Summary
Chapter 11: Microservices
Façade
Service selector
Aggregate services
Pipeline
Message upgrader
Failure patterns
Hints and tips
Summary
Chapter 12: Patterns for Testing
The testing pyramid
Testing in the small with unit tests
Arrange-Act-Assert
Fake objects
Test spies
Stubs
Mock
Monkey patching
Interacting with the user interface
Tips and tricks
Summary
Chapter 13: Advanced Patterns
Dependency injection
Live post processing
Aspect oriented programming
Mixins
Macros
Tips and tricks
Summary
Chapter 14: ECMAScript-2015/2016 Solutions Today
TypeScript
BabelJS
Tips and tricks
Summary

What You Will Learn

  • Harness the power of patterns for tasks ranging from application building to code testing
  • Rethink and revitalize your code with the use of functional patterns
  • Improve the way you organize your code
  • Build large-scale apps seamlessly with the help of reactive patterns
  • Identify the best use cases for microservices
  • Get to grips with creational, behavioral, and structural design patterns
  • Explore advanced design patterns including dependency injection

Authors

Table of Contents

Chapter 1: Designing for Fun and Profit
The road to JavaScript
What is a design pattern?
Anti-patterns
Summary
Classical Design Patterns
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 2015 classes and modules
Best practices and troubleshooting
Summary
Chapter 3: Creational Patterns
Abstract factory
Builder
Factory method
Singleton
Prototype
Tips and tricks
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: Reactive Programming
Application state changes
Streams
Filtering streams
Merging streams
Streams for multiplexing
Hints and tips
Summary
Chapter 8: Application Patterns
First, some history
Model View Controller
Model View Presenter
Model View ViewModel
Tips and tricks
Summary
Chapter 9: Web Patterns
Sending JavaScript
Plugins
Doing two things at once – multithreading
Circuit breaker pattern
Promise pattern
Hints and tips
Summary
Chapter 10: Messaging Patterns
What's a message anyway?
Request-reply
Publish-subscribe
Dead letter queues
Hints and tips
Summary
Chapter 11: Microservices
Façade
Service selector
Aggregate services
Pipeline
Message upgrader
Failure patterns
Hints and tips
Summary
Chapter 12: Patterns for Testing
The testing pyramid
Testing in the small with unit tests
Arrange-Act-Assert
Fake objects
Test spies
Stubs
Mock
Monkey patching
Interacting with the user interface
Tips and tricks
Summary
Chapter 13: Advanced Patterns
Dependency injection
Live post processing
Aspect oriented programming
Mixins
Macros
Tips and tricks
Summary
Chapter 14: ECMAScript-2015/2016 Solutions Today
TypeScript
BabelJS
Tips and tricks
Summary

Book Details

ISBN 139781785882166
Paperback290 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Node.js Design Patterns - Second Edition Book Cover
Node.js Design Patterns - Second Edition
$ 39.99
$ 10.00
Mastering JavaScript Object-Oriented Programming Book Cover
Mastering JavaScript Object-Oriented Programming
$ 35.99
$ 10.00
JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 10.00
Node.js 6.x Blueprints Book Cover
Node.js 6.x Blueprints
$ 39.99
$ 10.00
Developing Microservices with Node.js Book Cover
Developing Microservices with Node.js
$ 31.99
$ 10.00
ReactJS Blueprints Book Cover
ReactJS Blueprints
$ 35.99
$ 10.00