Learning JavaScript Design Patterns – For better JavaScript and jQuery coding – #programming #bookreview

Learning JavaScript Design Patterns
Addy Osmani
(O’Reilly, paperbackKindle)

New to JavaScript and jQuery or looking to expand your skills? This well-focused how-to guide can help you learn how to recognize and apply reusable design patterns to your coding.

“A pattern is a reusable solution that can be applied to commonly occurring problems in software design—in our case, in writing JavaScript web applications,” Addy Osmani notes in his new book. He is a developer programs engineer on the Chrome team at Google, and he is a frequent contributor to publications such as JavaScript Weekly.

“Another way of looking at patterns is as templates for how we solve problems—ones that can be used in quite a few different situations,” Osmani adds.

In his view, design patterns offer three key benefits for JavaScript and jQuery developers. First, the patterns offer “proven solutions….They provide solid approaches to solving issues in software development using proven techniques….” created and tested by others. Second, design patterns “can be easily reused” and offer “an out-of-the-box solution that can be adapted to suit our own needs.” And, third, “patterns can be expressive…there’s generally a set structure and vocabulary to the solution presented that can help express rather large solutions quite eloquently.”

Osmani also emphasizes that patterns do not provide “exact solutions…the role of a pattern is merely to provide us with a solution scheme.” But a key goal of his book is to convince JavaScript and jQuery  developers that “[r]eusing patterns assists in preventing minor issues that can cause major problems in the application development process.”

Learning JavaScript Design Patterns (235 pages) is structured with 14 chapters and an appendix.

  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
  10. JavaScript MV* Patterns
  11. Modern Modular JavaScript Design Patterns
  12. Design Patterns in jQuery
  13. jQuery Plug-in Design Patterns
  14. Conclusions

The appendix, “References,” includes 39 links for additional information related to JavaScript design patterns.

The author offers numerous code samples and graphics to help illustrate his explanations. He provides looks at more than 20 “classical and modern” design patterns in JavaScript. And he explains several choices for writing modular code, including the Module pattern, Asynchronous Module Definition (AMD), and CommonJS.

He also describes design patterns available within the jQuery library and explores “a number of jQuery plug-in patterns that have worked well for other developers in the wild.”

Addy Osmani’s well-written book provides clear guidance to understanding how adapting and using existing design patterns can help software developers work more efficiently and effectively in JavaScript and jQuery.

Si Dunn

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s