Create timeless memories with the perfect camera
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

Pro JavaScript Design Patterns: The Essentials of Object-Oriented JavaScript Programming First Edition


{"desktop_buybox_group_1":[{"displayPrice":"$45.18","priceAmount":45.18,"currencySymbol":"$","integerValue":"45","decimalSeparator":".","fractionalValue":"18","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"r8KHQDzHUx%2B36tshvcEMUmw18YgJRNtPmEFsWYGHcR01dmJ82Suc6oNnyeXMgfT2JOdAT7cWps5jpDD6XZUtrhotwMRnXt532AyfncaLKT1QnWLa6SL30eFZ4igFDuwtuukaYkEt5W0%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}]}

Purchase options and add-ons

As a web developer, you'll already know that JavaScript is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked―JavaScript is capable of full object–oriented capabilities, and by applying object-oriented principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team.

With Pro JavaScript Design Patterns, you'll start with the basics of object–oriented programming in JavaScript applicable to design patterns, including making JavaScript more expressive, inheritance, encapsulation, information hiding, and more. With that covered, you can kick–start your JavaScript development in the second part of the book, where you'll find detail on how to implement and take advantage of several design patterns in JavaScript, including composites, decorators, façades, adapters, and many more.

Each chapter is packed with real–world examples of how the design patterns are best used and expert advice on writing better code, as well as what to watch out for. Along the way you'll discover how to create your own libraries and APIs for even more efficient coding.

  • Master the basics of object–oriented programming in JavaScript, as they apply to design patterns
  • Apply design patterns to your kick–start your JavaScript development
  • Work through several real–world examples

Editorial Reviews

About the Author

Dustin Diaz is a user interface engineer for Google in Mountain View, California. He enjoys writing JavaScript, CSS, and HTML, as well as making interactive and usable interfaces to inspire passionate users.

Product details

About the author

Follow authors to get new release updates, plus improved recommendations.
Ross Harmes
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Discover more of the author’s books, see similar authors, read book recommendations and more.

Customer reviews

4.1 out of 5 stars
42 global ratings

Customers say

Customers find the book well-explained, particularly praising its coverage of design patterns and OOP principles. Moreover, the code quality receives positive feedback, with one customer noting it successfully implements patterns in JavaScript. Additionally, the writing style is appreciated, with one review highlighting how it helps make code more scalable. Customers also value the book's user-friendly approach, making it suitable for both beginners and advanced developers.

6 customers mention "Code quality"5 positive1 negative

Customers appreciate the code quality of the book, with one customer noting the clear code snippets and another mentioning how it improved their approach to JavaScript and coding.

"...Well structured and written, good, well explained and clear code snippets that, for the most part, can you copy/paste and use." Read more

"Everything is clearly explained, and the code is very useful. A very good framework to base an advanced project on." Read more

"...well, covers the content in a way that made sense, and helped me fall in love with javascript...." Read more

"...are an excellent review of OOP principles and how to successfully implement them in Javascript...." Read more

6 customers mention "Explanation quality"6 positive0 negative

Customers find the book well-explained, with one customer highlighting its comprehensive coverage of OOP principles and another noting its framework-independent approach.

"Everything is clearly explained, and the code is very useful. A very good framework to base an advanced project on." Read more

"...Well structured and written, good, well explained and clear code snippets that, for the most part, can you copy/paste and use." Read more

"...The first six chapters are an excellent review of OOP principles and how to successfully implement them in Javascript...." Read more

"Great book and wonderful information about JavaScript. I'm trying to punish my brain with JavaScript knowledge." Read more

6 customers mention "Writing style"5 positive1 negative

Customers appreciate the writing style of the book, with one mentioning its organized approach to clean JavaScript, while another notes that the descriptions are clear and helps make code more scalable.

"...Well structured and written, good, well explained and clear code snippets that, for the most part, can you copy/paste and use." Read more

"...of the patterns or concepts in your code, it will help make the code you write more scalable, extensible, and longer lasting." Read more

"...looking to learn and develop a well-structured and organized approach to writing clean Javascript...." Read more

"...Descriptions are written clearly and the code examples are copious...." Read more

4 customers mention "Design patterns"4 positive0 negative

Customers find the design patterns in the book well-explained, with one customer noting that they make implementation easier.

"I am better at design patterns, but still believe that my code itself is still trash. This book is user friendly from beginner to advanced...." Read more

"...The authors stick with mainstream, well-know patterns, nothing new, but they "translate" those patterns in JavaScript, offering working samples...." Read more

"...The rest of the book reads easy since the design patterns are explained well and then integrate different use-cases into each pattern's lesson...." Read more

"For any serious front end / JavaScript developer, Pro JavaScript Design Patterns is a must have!..." Read more

3 customers mention "User friendly"3 positive0 negative

Customers find the book user-friendly, with one mentioning it is suitable for both beginners and advanced developers, while another notes it is easy to read.

"...The rest of the book reads easy since the design patterns are explained well and then integrate different use-cases into each pattern's lesson...." Read more

"...This book is user friendly from beginner to advanced. Highly recommend." Read more

"...It's framework independent so it's usable for all JS developers..." Read more

Top reviews from the United States

  • Reviewed in the United States on August 10, 2010
    Format: PaperbackVerified Purchase
    Must warn the reader that I'm not a great JS hacker and probably only a decent engineer in general . . However, having seen (and probably written) quite a bit of hokey and shoddy code to get the job done, I'm hoping I've learned enough to distinguish the good from the bad.

    With that being said . . I'd highly recommend this book for all the developers looking to learn and develop a well-structured and organized approach to writing clean Javascript. The first six chapters are an excellent review of OOP principles and how to successfully implement them in Javascript. The rest of the book reads easy since the design patterns are explained well and then integrate different use-cases into each pattern's lesson. Each chapter also has a succinct summary detailing when and how to apply the covered design pattern. Overall, I really enjoyed the book and feel like it's improved my approach to Javascript and coding.
    One person found this helpful
    Report
  • Reviewed in the United States on June 16, 2008
    Format: PaperbackVerified Purchase
    Back in the early days Design Patterns examples mostly used C++ as language. This day Java is the typical choice, with an increasing amount of C#. Usually if you are familiar with any of those languages, porting the sample code to a different platform isn't that hard. Unfortunately JavaScript is quite a different beast, first of all is not class based, it's loosely typed, it doesn't support interfaces etc. JavaScript has a whole bunch of peculiarities that make it really hard to translate those Java/C# samples. That's why this book is really welcomed. The authors stick with mainstream, well-know patterns, nothing new, but they "translate" those patterns in JavaScript, offering working samples. I tend to disagree with them whenever they pretend to add interface-like functionality to JavaScript; yet, I think they made an excellent job, a book that can be really valuable if you do non-trivial work with JavaScript
    4 people found this helpful
    Report
  • Reviewed in the United States on March 14, 2011
    Format: PaperbackVerified Purchase
    Let me just say this up front--this book contains some advanced JavaScript techniques and code, and is not for the beginning or even intermediate JavaScript programmer. Even advanced practitioners may want to go back through for a second reading to ensure that all the concepts within are fully understood, especially when and how to use these patterns, as well as the advantages and disadvantages of each in context of the JavaScript implementations. Here we have two advanced authors, one from Google (Dustin Diaz), the other from Yahoo! (Ross Harmes), who have extensive experience building large-scale JavaScript-based API systems. They present 12 design pattern implementations in JavaScript, with examples of how each could be used, as well as the important core concepts of interfaces, encapsulation, information hiding, inheritance and chaining. Even if you only come away from the book learning and implementing one of the patterns or concepts in your code, it will help make the code you write more scalable, extensible, and longer lasting.
    3 people found this helpful
    Report
  • Reviewed in the United States on June 28, 2010
    Format: Paperback
    There are some good ideas in this book, and it's worth a quick read, but it is desperate need of strict editing. Some of the concepts are implausible or even harmful, and many of the code examples contains typos that prevent them from being run as shown.
    2 people found this helpful
    Report
  • Reviewed in the United States on May 1, 2014
    Last week I finished reading it and I just wanted to say how much I enjoyed it. Well structured and written, good, well explained and clear code snippets that, for the most part, can you copy/paste and use.
  • Reviewed in the United States on October 12, 2011
    Format: PaperbackVerified Purchase
    For any serious front end / JavaScript developer, Pro JavaScript Design Patterns is a must have! Descriptions are written clearly and the code examples are copious. If you think you know design patterns in JavaScript, get the book anyway - it will make implementing patterns even easier.
  • Reviewed in the United States on May 12, 2015
    For those who are interested in OOP javascript this is one of the best books.
  • Reviewed in the United States on April 9, 2021
    Format: PaperbackVerified Purchase
    I am better at design patterns, but still believe that my code itself is still trash. This book is user friendly from beginner to advanced. Highly recommend.

Top reviews from other countries

  • Kaonashi
    5.0 out of 5 stars Five Stars
    Reviewed in the United Kingdom on February 17, 2017
    Format: PaperbackVerified Purchase
    Great book
  • Kindle Customer
    5.0 out of 5 stars Superb
    Reviewed in Australia on September 28, 2020
    Format: PaperbackVerified Purchase
    Years after, this book is still very relevant .

    A no nonsense approach to Design patterns in JavaScript ,I'll highly recommend
  • Motoki014
    4.0 out of 5 stars 面白い
    Reviewed in Japan on July 10, 2009
    Format: PaperbackVerified Purchase
    JavaScriptは、ホームページ作成だけでなく、業務システムでも利用されています。
    業務の画面表示仕様に則って、コーディングしていくうちに、とてつもなく巨大なスクリプトファイルが出来ており、保守担当者が悲鳴を上げているのをよく目にしました。

    そこで、JavaScriptの可読性を上げるにはどうすれば良いか?と考えた時に、この本に出会いました。

    この本は、JavaScriptを見事にオブジェクト指向にしており、Gofデザインパターンへの適応を行っています。
    この本のサンプルは、本に記載のHPからすべてダウンロードすることができます。

    CHAPTER2のInterfaceの章は、オブジェクト指向言語のInterfaceをJavaScriptで実現しようと試行錯誤が伺えました。
    実装クラスがInterfaceのメソッドを定義しているか、というのは、他の”言語”はコンパイラによって判断されますが、Javascriptは自分でチェックロジックを作るしかありません。
    このCHAPTERを読んでいて、果たしてJavaScriptでInterfaceを作るメリットが・・・というキーワードが浮かんできてしまいました。
    #チェックロジックを書く労力の割に、効果がないですね

    このペースで全CHAPTERの感想を書くと長くなるので・・・

    [CHAPTER6 Chaining][CHAPTER9 THE COMPOSITE PATTERN]は非常に参考になりました。

    その他のCHAPTERは、Ajaxのコンポーネントを作成する様な方が見ると非常に参考になると思います。
    #実際には、オープンソースのコードを読んで理解した方が良いと思いますが・・・

    本書を読んで、冒頭に登場した「保守担当者の悲鳴」は、解決できそうにありませんでした(笑)

    この技術を取り入れるには、オブジェクト指向且つ、JavaScriptのエキスパートがいないと難しそうなので、業務システムの実用は、プロジェクトに参画する要員のスキルに依存しそうです。

    私と同じ問題を抱えていて、期待を胸に本書にたどり着いた人にはおすすめできません(笑)

    オープンソースのAjaxコンポーネントをカスタマイズしたい、Ajaxコンポーネントを作りたい人におすすめと思いました。
  • Hato
    5.0 out of 5 stars The book I was waiting for
    Reviewed in Germany on May 2, 2009
    Format: PaperbackVerified Purchase
    This book shows in an excelent way, how to realize well known object oriented patterns with JavaScript. It gives exsamples and explains in detail the differences between prototypical and classical inheritance. There are some very helpfull functions delivered for e.g. Interface simulation, extending or augmenting classes, which can be reused in own projects.
    I can recommend the book to experienced JS programmers and developers who are experienced in object orientation with other programming languages and design patterns. Nothing for beginners but great for experts!
  • Segun
    4.0 out of 5 stars Pro JavaScript Review
    Reviewed in the United Kingdom on September 20, 2010
    Format: PaperbackVerified Purchase
    The level of JavaScript required on some project I was working on made me feel very dumb, this book was recommended, I bought it, read only the first few chapters and felt less dumb right away, especially as it said 'not knowing that level of JS does not mean you are dumb'. I've not gotten past those chapters by the way, I hope to do so at some point though.