Pro JavaScript Design Patterns

  Author:    Dustin Diaz, Ross Harmes
  ISBN:    159059908X
  Sales Rank:    44908
  Published:    2007-12-17
  Publisher:    Apress
  # Pages:    400
  Binding:    Paperback
  Avg. Rating:    5.0 based on 10 reviews
  Used Offers:    8 from $28.95
  Amazon Price:    $31.07
  (Data above last updated:  2008-08-17 06:17:20 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
Pro JavaScript Design Patterns
  

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 OOP 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.

What you’ll learn

  • How to apply object–oriented programming techniques in JavaScript
  • How to take advantage of inheritance, interfaces, and encapsulation and information hiding to kick–start your JavaScript development
  • How to implement several design patterns in your JavaScript projects, including factory, façade, bridge, composite, adapter, decorator, flyweight, proxy, command, observer, and chain of responsibility
  • How to make your code easier to manage in a team environment, as well as on your own
  • How to create your own libraries and APIs

Who is this book for?

This book will be an invaluable learning tool for any experienced JavaScript developer.

About the Apress Pro Series

The Apress Pro series books are practical, professional tutorials to keep you on and moving up the professional ladder.

You have gotten the job, now you need to hone your skills in these tough competitive times. The Apress Pro series expands your skills and expertise in exactly the areas you need. Master the content of a Pro book, and you will always be able to get the job done in a professional development project. Written by experts in their field, Pro series books from Apress give you the hard–won solutions to problems you will face in your professional programming career.

Related Titles

  • Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional
  • Pro JavaScript Techniques
  • Pro DOM Scripting with Ajax, APIs, and Libraries
  • Practical JavaScript , DOM Scripting, and Ajax Projects
                  Reader Reviews 1 - 10 of 10                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
07-07-08 5 (NA)
(Hide Review...)  Required reading to advance the skill level of experienced programmers
Reviewer Permalink
To begin with this is not a book for the person new to JavaScript. The authors assume some knowledge of JavaScript and object oriented programming right from the start. This is more of an advanced text for those who already can get things done in JavaScript and want to advance their knowledge, write code that is easier to maintain, and exploit the flexibility of JavaScript to its fullest extent.

For each pattern discussed they provide background information on the problem to be resolved, example coding, and when to use it. I appreciated this detail in helping me to fully understand not only when a pattern could be used to benefit a project but also when it might not be the most appropriate way. While JavaScript has always been known for its flexibility these authors show how a creative person can exploit the language's flexibility.. The patterns themselves represent pretty common ones in other languages but the way they were implemented in JavaScript was enlightening.

This is an excellent guide and reference for high-level JavaScript programming on large projects maintained by multiple programmers. Pro JavaScript Design Patterns is highly recommended for experienced object oriented programmers who want to add this to their knowledge base.
(Review Data Last Updated: 2008-08-17 06:18:59 EST)
07-07-08 4 (NA)
(Hide Review...)  great next step book
Reviewer Permalink
it's a great book to learn more.....it's missing practical examples for real life.....lot of theory. If you don't know Object Oriented Principles, it will be (very) hard(er). (ActionScript 3.0 book can help, or Java book ).

It's not begginer book........It's great for large projects, applications.
This is great for frontend engineers and software engineers.
I would recommend JavaScripts Good Parts in addition to this, it could help with coding standards....

Unfortunatelly, there is no single Javascript book.

Many of them are old and lousy......

As UI/Front End Developer, it's nice to have a book like this. it's very helpfull for sure.

What's missing, HOW TO - the connection to real Javascript frameworks, like YUI, JQuerry, Mootools, Prototype, Dojo, etc, etc, etc.






(Review Data Last Updated: 2008-08-17 06:18:59 EST)
06-16-08 4 (NA)
(Hide Review...)  Valuable if you do non-trivial work with JavaScript
Reviewer Permalink
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
(Review Data Last Updated: 2008-07-07 01:42:37 EST)
05-28-08 5 (NA)
(Hide Review...)  Great book, highly recommend
Reviewer Permalink
The authors of this book, being recognized web experts in Google and Yahoo circles, are sharing an array of javascript design patterns that will empower your applications and widen horizons of all web developer levels.
(Review Data Last Updated: 2008-06-16 05:31:01 EST)
05-27-08 5 2\2
(Hide Review...)  This book rocks!
Reviewer Permalink
Harmes and Diaz bend, twist, fold and stretch the Javascript language in ways that it wasn't probably intended to ever be used and, in doing so, demonstrate just how flexible and dynamic Javascript is. They actually cover topics such as Interfaces, encapsulation, inherittance, the singleton pattern, the factory pattern, the bridge pattern, the composite pattern, the adapter pattern, the proxy pattern, the lightweight pattern and the command pattern.

Early on in the book when looking at the interface pattern, when it was suggested an implementation of this pattern with comments, I actually thought that this just wasn't going to work for me. They do, however, show a much more credible implementation of this and other patterns and, in the process, cover some of the deeper and more powerful features of the language. The examples are highlighted against specific applications. For instance, the benefits of the singleton pattern are explained through the process of creating an XHR object (an instance of the XMLHttpRequest).

I haven't finished the book yet, but it is clear that this is one to keep going back to. As someone else has already mentioned, this is not a showcase of UI tricks and will be appreciated by someone developing or extending web development frameworks or someone who just wants to write better and more extensible Javascript.

I would have liked to have seen some examples of how the patterns are used in frameworks such as Prototype/Scriptaculous and jQuery in the same vein that Olsen's "Design Patterns in Ruby" (an excellent book if you are into Ruby) illustrates patterns with code used in Rails, Ruby and other applications in the wild. Also, I found that I needed to brush up on my Javascript (bigtime) in order to keep up with this one (Resig's "Pro Javascript Techniques" and Crockford's "JavaScript: The Good Parts" are highly recommenced to that end). Then again, the Authors might have then struggled to keep this at just under 270 pages.

Highly recommended!

(Review Data Last Updated: 2008-06-16 05:31:01 EST)
03-30-08 5 (NA)
(Hide Review...)  for javascript or server side language developers
Reviewer Permalink
"Pro JavaScript Design Pattens"is a useful read regardless of whether you have a JavaScript or server side language background. An advanced topic that appeals to such varied audiences is tough to do, but the authors succeed admirably. In fact, I can't do such a job, so read the chapter that applies...

For JavaScript developers:
The book covers how to write good clean object oriented code in JavaScript. It introduces concepts that are not present in JavaScript along with how to simulate them. The sections on when to use a given pattern are well written.

For server side language developers:
The book covers how to implement in JavaScript the design patterns we are accustomed to. Before getting to this, there are several chapters on JavaScript idioms which are very useful. There were also a couple patterns that a server side developer might not have encountered because the server side is not so memory constrained.

For everyone:
The book also covers tradeoffs of using the patterns. I appreciated where they mention the slight performance hit and how to check/profile if it is a problem for you. All patterns were described clearly and succinctly. There were some real examples as well. At times, it is a bit code heavy - one example had 1.5 pages of implementation details that had nothing to do with the topic at end. Overall, I think the book was great. If you have a significant amount of JavaScript code, the concepts in this book are critical.
(Review Data Last Updated: 2008-05-28 04:54:44 EST)
03-25-08 5 2\2
(Hide Review...)  Toughie not fluffy
Reviewer Permalink
This book is a "JavaScript for Programmers" book. It's very detailed and advanced. I wouldn't classify it as a "JavaScript for Web Weenies" or a "JavaScript for Stupid UI Tricks" book at all. If you don't know OOP concepts in another language already, this book really might be too much for you and could frustrate you. This book is good if you are a server-side programmer and you want to know how to push JavaScript about as far as it can go (at this point). If you are a web programmer/designer with a light understanding of OOP concepts and you want to "go deep", this book could be ok, but I would try to learn OOP from another language first because this book would read better with that background knowledge. Also, I am recommending that you already know OOP from another language because you can really shoot yourself in the foot with JavaScript because it's *so* flexible and the authors prove this well! I think it's probably a good idea to know when you're going off in the weeds and JavaScript really doesn't provide many boundaries where other languages have stricter controls on what you can do.

This book shows that when used by an experienced person, JavaScript is no joke. Seriously.
(Review Data Last Updated: 2008-03-31 19:42:59 EST)
01-26-08 5 1\3
(Hide Review...)  A more thorough treatment of advanced JS concepts would be hard to find
Reviewer Permalink
This book provides one of the more thorough treatments of some of the more advanced javascript idioms/concepts - it's not aimed at the beginner - and it does have some typos (for e.g defining functions as obj.fun() { } vs obj.fun = function() {...} - and while i haven't completed reading it (it is a design patterns book after all) - I have been quite impressed with it's initial chapters (encapsulation, inheritance, singletons etc.)
And as you would expect, this book does make it easier to follow library code written using the class-based OO pattern (such as extjs).


(Review Data Last Updated: 2008-03-25 21:29:32 EST)
01-25-08 5 4\5
(Hide Review...)  Want to be a JavaScript guru? Don't miss this one!
Reviewer Permalink
A bit hard to read unless you have the detailed knowledge of JavaScript and design patterns. Lack of figures to represent how things work and the idea behind all these.

Other than that, this is one of the GREATEST books about JavaScript you can find in the market, especially for those who want to know more about the JavaScript and design pattern.
(Review Data Last Updated: 2008-03-25 21:29:32 EST)
01-20-08 4 (NA)
(Hide Review...)  An excellent title for experienced JavaScript developers
Reviewer Permalink
Design patterns, and particularly their application in dynamic languages can be a controversial topic, and every now and again another round of blog posts bubbles up appalled at the way a new group of programmers have become infatuated with design patterns. Applied without care design patterns can quickly lead to over-engineered code that seems designed as much to draw on as many of the established patterns as possible as to solve the intended problem. But if applied with care, and with consideration of how a pattern applies in the context of your chosen language they can be a helpful way to draw on the wisdom of the coders that came before you, and make your code easier to understand to those who may inherit it.

Written by Dustin Diaz (of Google) and Ross Harmes (of Yahoo), Pro Javascript Design Patterns builds on experience of building complex, high profile javascript applications. That experience shows as each pattern is introduced with solid examples and sample code and then refined to provide looser-coupling, more flexibility and/or better performance.

Early on in the book I was concerned that some of the solutions could become too heavy and the early introduction of interfaces hinted at something akin to the early approaches to pattern usage in PHP, which often looked more like an attempt to turn PHP into Java than a way to use PHP's own features better. As the book goes on the usefulness of those interfaces, particularly for large development teams, becomes clear and most of those concerns are allayed, especially as the authors offer pros and cons for the use of each pattern and are clearly focussed on how these patterns can help produce more robust solutions.

Most of the patterns will have a fairly immediate impact for developers new to them, and even for those who have used them in other contexts it is helpful to see how they have been applied in JavaScript. Most modern JavaScript libraries rely on several of these patterns to abstract out handling of different browser quirks or adding new event types, and even if you rely heavily on one or more of the major libraries this guide may well help you understand their internals better.

I've sometimes been skeptical of books claiming to be targeted at an advanced target. Labels like "pro" are often handed out far too easily. But in this case it seems deserved. While the book does a good job of quickly introducing approaches to object-oriented programming in JavaScript, that's based on an assumption of a solid knowledge of the language and of OO development in at least one language. If you're a newcomer to JavaScript or just looking for a way to add a few fancy features to your web pages this isn't be book for you. But if you have some serious JavaScript development experience and are needing a way to tighten up your code to make it more modular and more maintainable, this book is well worth your time.

Disclaimer: I was sent a copy of this book for review by the publisher.
(Review Data Last Updated: 2008-01-25 15:55:27 EST)
  
                  Reader Reviews 1 - 10 of 10                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)