Mini-book Review: Ajax Design Patterns

I've been visiting Michael Mahemoff's web site Software As She's Developed off-and-on for about a year. He's an Ajax guru who does a cool podcast about his experiences with Ajax, and he even has a cool resouce called Ajax Patterns that has really helped me wrap my head around Ajax in general. I took the plunge and bought his excellent book "Ajax Design Patterns" since I am trying to improve my Javascript and presentation skillz because I want to be part of the modern web.

Working with Javascript (once I got over prejudices picked up from reading other people's comments about Javascript) seems very natural. If you know PHP, the syntax for Javascript is dead simple. This book, when combined with the efforts of my only-met-her-once-but-talk-all-the-time-via-IM friend Amy Hoy I feel like I'm starting to finally understand the impact using Javascript can have on a web site.

I'm only about 5 chapters in at this point but those 5 chapters have led me to believe that I made a solid choice in picking up this book. Yes, this book focuses on "Ajax design patterns" but it really has a recipes-style feel to it. As an aside, this book was on the shelf at my local bookstore near Chad Fowler's Rails Recipes book. Yes, fate has a sense of humour.

So, Michael goes through all sorts of design patterns by presenting them as follows:

  • a story to illustrate what the problem is, usually in real-world terms
  • a technical breakdown of the problem
  • a neat section called "Forces" that explains concepts or items that you will encounter in applying the pattern
  • how the problem was solved using the design pattern
  • real-world examples if there are any
  • and the most important thing to a lazy programmer like me: code examples

When I first encountered design patterns, I didn't quite understand what they were or how they could help me. These days, I have acquired the habit of figuring out the problem in words instead of code and then finding solutions to the words. Design patterns are a shortcut to help you solve problems that, well, other people have already solved. Hopefully you learn something in the process. :)

This book is no different. I found it so easy to jump around the book, reading up on a particular pattern ("Cross-Domain Proxy") to find what problem it's helping to solve ("How can you augment your application with services available elsewhere on the Web?) to what the short version of the solution is ("Create proxying and mediating web services to facilitate communication between the browser and external domains") and what other patterns are related to this one ("Since external calls can be expensive, the Performance Optimization patterns apply.").

I'm into reference books with examples on how to do things, so this book is obviously a natural for me. Go check out Michael's site and if you are looking to really *understand* Ajax then Ajax Patterns should be your first stop.