Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Book Reviews Books Media

Ajax Design Patterns 39

pankaj_kumar writes "A number of AJAX libraries and frameworks have emerged to purportedly simplify development of rich Internet Apps. None of them however can substitute a good understanding of what the recurring problems are, the potential solutions and what goes on behind the sleek facade of a browser to power these Apps . Michael Mahemoff, author of Ajax Design Patterns, said this best in his blog which became a popular wiki entry and later, this book." Read the rest of Pankaj's review.
Ajax Design Patterns
author Michael Mahemoff
pages 635
publisher O'Reilly
rating 9
reviewer Pankaj Kumar
ISBN 0-596-10180-5
summary Creating Web 2.0 Sites with Programming and Usability Patterns


The Ajax Design Patterns book, with its more than 70 design patterns, documented in more than 600 pages with encyclopedic detail, is very effective in presenting the AJAX programming knowledge in a reader friendly format. In the spirit of seminal GoF Design Patterns work, it captures the essence of each of the topics with problem solving approach — first stating the problem in general terms and then presenting the solution, outlining the approach and discussing variations, alternatives, trade-offs and even listing actual uses in real applications. Btw, if you noticed I used the term topics in the previous sentence to refer to its 70+ "knowledge modules" and not patterns, mostly because I wouldn't categorize all of them as patterns. However, this disagreement on terminology doesn't take away anything from their practical usefulness and, for sake of consistency, I would continue calling them "design patterns".

A bit on scope and level of material presented in the book — most of the material is quite advanced and assumes good knowledge of technologies for writing web based applications: HTTP, JavaScript, (X)HTML, CSS, PHP and a bit of W3C DOM. The code fragments, and there are quite a few of those, are in JavaScript (for client side) and PHP (for server side). Most of the prominent AJAX libraries, toolkits and frameworks are also mentioned, often while discussing a particular pattern as a reference of actual use. The appendix lists them all at one place and highlights their main features. Though, the book carefully avoids to recommend any one as 'The AJAX toolkit'.

The book categorises the design patterns as Foundational Technology Patterns (those related to repainting the user interface, browser and web server communication, and event handling), Programming Patterns (those related to programming aspects of either end, browser or the service, of the application), Functionality and Usability Patterns (those related to functional widgets such as slider, data grid, progress indicator etc., page layout, visual effects and so on) and Development Patterns (those related to debugging and testing). Of course, the real value is in the details of each pattern, and not just the high level categorization or overview.

A reader of this review may be interested in knowing why should he or she buy the book when most of the content is freely available at the Ajax Patterns Wiki. Here is my take on this: although most of the content is available on the Wiki, the text in the book has gone through professional editing and is more readable. Also, the description of most of the patterns run into multiple pages, and it becomes hard to read long articles while connected to the Internet (I tend to click on links and wander away). As an additional bonus, the book includes illustrative diagrams, which I found quite helpful, and at times, funny. Most of the patterns included in the book taught me something new, I did end up with a list of favourites after finishing the book in less than a week: XMLHttpRequest Call: One of the most comprehensive treatment of XMLHttpRequest object and its various use patterns, limitations and alternatives. On-Demand JavaScript: How to do lazy loading of JavaScript code to improve responsiveness or get data from a different server. HTTP Streaming: How can a server keep sending data to the browser over an HTTP connection initially established by the browser. Call Tracking, Submission Throttling: How to protect your server from excessive load by very active users without compromising responsiveness. Browser-Side Cache: Ajax doesn't solve the inherent latency problem of the Internet. You still need the good old tricks to improve the user experience. Malleable Content: How to let the user edit some information on a mostly read-only page. One-Second Spotlight, One-Second Mutation: How to communicate change in a portion of the page without being obtrusive. Direct Login: How can you improve the user experience as well as the security of authenticating user using Ajax and JavaScript wizardry. Unique URLs: Going Ajax should not require your users to abandon joys of hyperlinking and the old and tried habits of navigating content by clicking on the familiar back and forward buttons.

So far I have only been talking about things that I liked but there are some things I would consider weak spots. I noticed a few minor typographical issues with certain code fragments, but they are rarely serious. For example the first code fragment on page 96 has uses variable requestTimer to store the return value of setTimeout() and then uses variable requestTimeout as argument to clearTimeout().

A good addition for a future edition could be patterns on AJAX program performance during development, deployment and runtime such as JavaScript compression to improve download times and execution speed and considerations on using multiple third party JavaScript libraries.

Another thing I found a bit annoying at times is presence of a lot of URLs all over the text with hints too brief to allow uninterrupted reading away from the computer. I would have preferred numbered footnotes, either in each page or at the end of each pattern, with URLs and a brief summary of its contents. Usually I read printed books when away from the computer and do not wish to go to the computer and type-in the URLs to just understand what is being said in the text. Although immensely helpful during online viewing, the embedded URLs are a hinderance during offline reading. This is one area where the structure of printed content should be different from the online content.

Overall, I would recommend the Ajax Design Patterns to all those who work or aspire to work on web development projects as an excellent reading and reference resource.


You can purchase Ajax Design Patterns from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Ajax Design Patterns

Comments Filter:
  • by Naum ( 166466 ) on Wednesday January 10, 2007 @05:15PM (#17546264) Homepage Journal
    To date, IMV.

    Unfortunately, I've plunked down money for a bunch of hardcopy books on AJAX and the new fangled javascript tidings — yes, I know I could find most of the requisite documentation online and/or I even question the silliness of amassing a library over a simple API call and a few demonstrative examples. But if I were to choose one book to buy or keep on the subject, this would be the one, easily.

    Why? Well, because the author takes a problem centric view after a basic tutorial (i.e., how to handroll your own remoting, simple code examples). Then, all the things you can do with the tools are detailed, within a templated question and answer framework, and unlike the reviewer here, I appreciated the inclusion of all the URLs so I could research further. Also, a big part of learning anything is just getting the terminology down, so that those can serve as "keys" for subsequent knowledge acquisition. Also, the author doesn't seem mentally tied down to a given platform (take note .NETers and Rubyists) and explains things from a purely algorithmic perspective.

    This is a worthy title for anyone wishing to expand their AJAX knowledge, though if you're totally comfortable with online discovery, you could forego it.

  • by Anonymous Coward on Wednesday January 10, 2007 @05:39PM (#17546730)
    Barnes and Noble is selling this book for $44.99, but Amazon.com is only selling it for $31.04!
     
    Save yourself $13.95 by buying the book here: Ajax Design Patterns [amazon.com]. That's a total savings of 31.01%!
  • by HvitRavn ( 813950 ) on Wednesday January 10, 2007 @06:51PM (#17547974)
    AJAX Patterns [ajaxpatterns.org]
  • Re:Whacky AJAX (Score:3, Informative)

    by elbobo ( 28495 ) on Wednesday January 10, 2007 @06:53PM (#17548024)
    My take on DHTML widget toolkits is this: It's too soon.

    Even the low level toolkits are still in their early stages, shaking out the initial design concepts and best approaches. So the situation in the higher level/GUI toolkits is going to be much worse. There's a very high risk of investing considerable code and project time into a toolkit only to discover that either it just doesn't fit with the project, or that the toolkit is still too quickly evolving to be a stable target.

    That rapid evolution is a symptom of something that's going to bite you in the arse: they haven't got them right yet! If they'd got it right, then the evolution would slow down.

    I've personally made a degree of use of the Prototype library, and become increasingly disillusioned with it when compared to the competing jQuery library. jQuery appears to be a much more elegant and future proof take on the problem.

    I've also put a fair amount of code into making use of the event:Selectors library which I have subsequently completely thrown out.

    My policy now is to only make use of the very minimum from the available libraries, while keeping a close eye on their development. AJAX/DHTML is reasonably light on lines of code anyway, so it's not as if you really *need* toolkits to get you through the projects. Eventually the best of breed toolkits will shake out and it'll be obvious what to use, when, and where. But that time hasn't come yet.
  • by Tim C ( 15259 ) on Wednesday January 10, 2007 @08:05PM (#17548972)
    I just don't put Usability "patterns" in the same category as the GoF patterns

    That's because you don't know what a pattern [cambridge.org] is. Note that nothing in that definition, that a pattern is "a particular way in which something is done" in any way references computing.

    A pattern is a way of doing something, a common solution to a common problem. That even applies to knitting patterns - the problem is that you have wool and no jumper, you follow the pattern, you have a jumper. Nothing about the GoF book makes them C++-specific - in fact, most patterns are entirely language-agnostic. To claim that AJAX isn't "complicated enough" to deserve patterns is to fall foul of language snobbery.

    Besides, who needs a book to learn AJAX?

    People who don't yet know programming (or XML, etc) and want a single reference to learn from? I've known some truly great designers who wanted to get into client-side scripting, etc, but who had so far had little or no exposure to programming. Believe it or not, some people manage to make a good living doing useful work without ever touching a compiler or interpreter...
  • by An Onerous Coward ( 222037 ) on Wednesday January 10, 2007 @08:17PM (#17549112) Homepage
    Nah, that wasn't flamebait. That was just some guy disagreeing with you.

    Now THIS is flamebait: Your post sounds like it comes directly from the "I've never done it, so it can't possibly be hard" school of thought.

    See the difference? In the latter instance, I'm questioning your competence in a none-too-subtle manner, in order to evoke a heated emotional response. Aside from the "Okay, smarty" (which seemed pretty justified given your apparent belief that AJAX techniques can be fully mastered in fifteen minutes by a drooling monkey), the guy was just explaining his position.

    I'm sure you're a top-notch programmer, and your approach to application design serves you very well. But what's up with this axe you're obviously grinding against all things AJAX-y?

    >> I'd roll my own. If I really needed to write an application that constantly transferred huge amounts back to the client, it'd probably be a clue that a proper desktop client/server app would be a better architecture.

    Of course, that loses all the advantages of developing it as a web app: no installation, multi-platform, the ability to access your data from just about any computer, etc. I don't see the advantages of a desktop app, unless the data being worked with changes infrequently enough to do client-side caching. But regardless, there are times and situations when you really want the sort of minimal barrier to entry that you can get with a web application.
  • by mahemoff ( 1049494 ) on Thursday January 11, 2007 @05:52AM (#17554000)
    Hi, this is Michael, the author of Ajax Design Patterns. I won't repeat what others have said already regarding the broad definition of patterns that this book assumes. Suffice to say, patterns didn't start with GoF and in fact, the basic idea - documenting common solutions in a consistent format - has been used in way or another for many decades, predating even Alexander's work. Here, I'd just like to add a couple of clarifications:
    • I understand where you're coming from if you consider the title to be stupendously hyped - "Ajax" and "Patterns" is buzzword squared. Well, the book is definitely about Ajax as most people (including Jesse James Garrett, coiner of the phrase) define it. As for "patterns", others have already stated why the Ajax Design Patterns are reasonablly called "patterns", but for those who think that the "patterns" term sells a book, this is not 2001 :-). There was a period between around 1999 and 2002 when dozens of books came out with "patterns" in the title, using it legitimately or not. I watched the trend closely as I have been working with patterns since 1997, and I subsequently watched as patterns then settled back to being a standard tool of our industry and no longer a hype term that sold books by its name alone. In fact, I spoke to an acquisitions editor for a prominent publisher in 2004, and she told me her company has an outright policy of not publishing anything to do with patterns - it was old hat by then. Fortunately, O'Reilly went with it because patterns is what I had set out to achieve on my blog and wiki prior to the book contract, but I don't think anyone saw patterns as a marketing tactic in the past five years.
    • Though not the original pattern reference by any means, GoF has an important place in the history of patterns and has been vital to my own development. I was therefore pleased that one of the authors, Ralph Johnson, took a special interest in the book, conducting a series of review sessions [softwareas.com] on the book draft with his architecture group at Illinois. The MP3s are online (see previous link). While certain individual patterns come under scrutiny for their pattern-ness, the group overall takes it for granted that these are patterns and focuses on the content. This is actually the wish I expressed in the appendix to this book, anticipating the whole "pattern" debate...what's really important is the content, not the form. Patterns just happen to be a useful way to present reference material of this nature IMO.

You knew the job was dangerous when you took it, Fred. -- Superchicken

Working...