Learning JavaScript Design Patterns: A JavaScript and jQuery Developer’s Guide

By Addy Osmani; Publisher: O’Reilly Media


A design pattern is a reusable solution to a commonly occurring problem in software development. They are flexible guides to best practices that developers implement in their applications. A design pattern is essentially a template for problem solving. While they are not exact solutions to a problem, a design pattern is a guide to a solution.

When web applications move beyond trivial into complex, object oriented programming can provide methods to organize and structure code. JavaScript design patterns can provide reuse-ability of code. Abstraction and encapsulation of code are two advantages to using design patterns in JavaScript. Using object oriented code produces a more modular code that is less likely to clash with other sections of code in the project. Modularity and encapsulation help to prevent an application from falling prey to becoming a mass of spaghetti code that is hard to debug and maintain.

I enjoyed the book’s format. Early on the author explains design patterns in a historical context with code examples that relate to Javascript. Later, models and various frameworks are examined with links to additonal resources. The design patterns outlined in chapter 9 receive additonal examples in the chapter on jQuery. I would recommend the book for intermediate to advanced JavaScript coders. The material will not be useful for those with little experience or new to JavaScript.

Disclosure: I received a free e-book copy for review purposes.

Purchase Options