| ||||||||||||
|
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Amazon.co.uk Trade-In Store for more details. |
Product details
|
As a web developer, youll 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 unlockedJavaScript is capable of full objectoriented 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, youll start with the basics of objectoriented programming in JavaScript applicable to design patterns, including making JavaScript more expressive, inheritance, encapsulation, information hiding, and more. With that covered, you can kickstart your JavaScript development in the second part of the book, where youll 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 realworld 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 youll discover how to create your own libraries and APIs for even more efficient coding.
This book will be an invaluable learning tool for any experienced JavaScript developer.
Tags Customers Associate with This Product(What's this?)Click on a tag to find related items, discussions, and people.
|
|
Share your thoughts with other customers:
|
||||||||||||||||||||||
|
Most Helpful Customer Reviews
4 of 4 people found the following review helpful:
4.0 out of 5 stars
Very informative,
By
This review is from: Pro JavaScript Design Patterns (Recipes: a Problem-Solution Ap) (Paperback)
I used this book to attempt to get a better understanding of Javascript and it served this purpose remarkably well. I am a professional programmer by trade so I already know design patterns very well having studied the infamous "Gang of Four" book. This meant that I could look at each design pattern and see how it was implemented compared to other languages I know and see how they differed and how they were similar which was quite an interesting way of learning.
The book does however feature a very detailed look into how to write good Javascript in the first few chapters which was very useful. What it doesn't cover is things such as basic control structures, data types etc which you'd find with a more beginners book. The writers do a very good job of explaining each design pattern and the pro's and con's of each, when you'd use it and then how to implement it. They take a very terse dry subject and make it very readable. However this is by no means a comprehensive list of all the design patterns there are. It has the basics and that's it, but by the end of it you'll be competent enough to figure out the others by yourself. This along with Douglas Crockford's "Javascript the good parts" will keep you in good stead with any Javascript project.
3 of 3 people found the following review helpful:
3.0 out of 5 stars
A mixed bag. Informative but at times cryptic.,
By
This review is from: Pro JavaScript Design Patterns (Recipes: a Problem-Solution Ap) (Paperback)
This book gets 5 stars for illustrating Design Patterns within the context of usable examples. It's not as abstract as the Gang of Four book, much more in the realm of a Cookbook of practical examples.
But the book also has its flaws. * For one thing, duck typing as I understand it from the realms of using Groovy, doesn't mean you have to adhere to an interface, just provide the methods. Their implementation ties things together via an intermediary interface. To adhere to duck typing, the intermediary interface shouldn't strictly be necessary. * Their interpretation on how to implement an interface solely relied on the presence of a function/method name. Coming from a Java background originally, seeing a class implementing a method by name alone seems insufficient. The signature of the methods is also crucial. There were no assertions on the types or number of the arguments passed, which I thought an interface should adhere to. (I realise JavaScript is a dynamic language, so maybe there was grounds for this, but informing the readers why they went with the implementation they did warranted a discussion). The book also tends to fail in certain areas : * At times the book would make a suggestion as to something you could do, without showing an example : ** eg lazy loading Observer P223. ** Also, whenever the book forayed off into the realm of Ajax, server-side references were made to PHP scripts that weren't contained in the book (or code download :-( ). (example Chapter 7 Factory Pattern P107. The section on whitelisting was described. I was rather disillusioned not to see such code within the pages of the book showing how this is done). * At times the book would show a revised version of some code, without pinpointing the salient changes in the narrative, so you had to really study and compare code. (eg P248/9 - should have mentioned argument was now being passed in to function) * Chapter 6 on Chaining. The concept is something I'm familiar with, having used jQuery, but the tail end of the chapter seemed too cryptic for my taste. Too many missing pieces of the puzzle. * The lack of descriptive argument names for closure functions. Specifically: ** 1) string replace (page 152) - It can take a regular expression and closure as arguments. The closure itself is described with arguments called 'a' and 'b'. This is so unhelpful. If the string replace takes the regular expression/closure arguments, then I believe the arguments should be of the format capture group 1, capture group 2, .... capture group n, position, original text. As there was only one capture group I couldn't get my head around the code with all the cryptic variable names. ** 2) JavaScript 1.6 array functionality (some/filter) : These methods take a function closure that should return a boolean for each element in the array that is being processed : P219/220. As far as I'm aware the inner closure that these methods uses takes 3 arguments, the first is the item of the array, the second the index position. the third the array itself. I'm wondering if you specify a single argument ths just would be the item.... It seems quirky that the third argument is ever needed, since this is the array you are running some/filter upon to begin with...) But the author just uses a name e1. To me this just has no meaning whatsoever. And a return statement without a boolean seems plain wrong in the context of the some/filter closures. * P237 getContext('2d') - wasn't described. (I've since read about this in Pro HTML5. It's used in conjunction with the canvas tag, for two-dimensional graphics rendering. That book pointed out the fragility of this code. Canvas isn't available in all browsers and the code should be in a try catch block. Internet Explorer is the usual suspect here!). * P238 I couldn't see why author didn't move undo functionality into UndoDecorator, undo function itself.. * From time to time, the ordering of the code didn't help: ** (Chapter 8: example P110 - ssynchRequest. I suddenly though authors had gone all YUI on me (This is not native JavaScript). Only to find it mentioned for first time on P112. A quick heads up this is about to be covered would have worked wonders) ** (example P171/172. The code at top of P171 should have been shown first. This way by the time you get to see the function, you appreciate why it's been coded is such a way). * The author seems to flit between naming variables for functions with a lowercase at the start of the book, but by the end has flitted to uppercase. I thought uppercase variable names was supposed to be reserved for classes. * P132 ev should be e. * Chapter 8 P112 Why have send with (postData || null). The or null seems redundant. Describe reasoning. (Dustin tells me this is to translate undefined to null - as the send method only likes null or data) * Chapter 9 P131. Comment about implementation with Cookies not being best approach. Why give an example that is lame? Give me examples that are production ready! This is a 'Pro' series book right? * Chapter 12 (Decorator) has errors in the code. It's worth looking at the errata on the APress website here. It revolves around the use of 'this' to assign the superclass constructors. I think all of the Decorators in this chapter suffer from same fate, not just the one described. There seems to be a repeating pattern (pun intended)! If some of these issues had been addressed, I would have had no hesitation in awarding the book five stars, as it was an engaging and enjoyable read. It wasn't too heavy either, something you can easily read in a weekend.
1 of 2 people found the following review helpful:
4.0 out of 5 stars
Pro JavaScript Review,
By
This review is from: Pro JavaScript Design Patterns (Recipes: a Problem-Solution Ap) (Paperback)
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.
Share your thoughts with other customers: Create your own review
Would you like to see more reviews about this item?
|
|
|
|
|