Ajax Construction Kit: Building Plug-and-Play Ajax Applications
One Minute Review
Positives
- Full working examples provided in a working environment on the included Linux Live CD.
- General purpose techniques that can be reused in many different flavors of applications.
- Focuses on how to get it to work, not on the nuts and bolts of Ajax.
- In some cases, the focus on the "practical" side of things leaves the reader wanting for more implementation details.
- Using the author's own framework, rather than an existing community-supported framework such as Prototype, could leave the reader with additional learning to do.
Buy it now
Ratings and Stats
| ISBN: | 0132350084 | Relevance: | |
| Publisher: | Prentice Hall PTR | Readability: | |
| Author(s): | Michael Morrison | Overall: | |
| Bottom Line: | Overall, it depends on who you are. I think this book nails the author's target audience. However, if you want to know more about how Ajax works and how to do the more "complex stuff," you'll be disappointed. | ||
Intent and Audience
The author's stated focus is "not on teaching you Ajax" but "on showing you how to do cool things with Ajax." It is intended to be approachable by anyone with an HTML and/or CSS background, but doesn't necessarily require any programming/scripting language experience, though some Javascript and server-side scripting (especially PHP) experience will prove very helpful in digesting the content.
Chapter Highlights
Part I - Ajax Boot Camp
- Chapter 1 - Ajax and a Brave New World Wide Web
The author begins with a very nice high-level overview of what exactly Ajax is, using the example of a shipping charge calculator on an online shopping website as a model. He compares and contrasts a traditional web implementation versus an Ajax implementation of the calculator. He follows this up with a tour of some of the more successful Ajax applications from around the web, such as Flickr and Google Maps. This is followed by one of the best parts of the chapter, "Ajax isn't for everything." I've always found it refreshing when an author is willing to tell you that you shouldn't use the technology he is writing about for everything you build from now on. He follows with a more detailed discussion of the Ajax shipping calculator. All in all a nice intro. - Chapter 2 - Inside an Ajax Application
The author now quickly moves into the details of Ajax applications, discussing the various nuts and bolts involved in piecing one together: HTML, CSS, JavaScript, XML/Ajax Data, and in this case server-side PHP. He then briefly discusses the Ajax request lifecycle, followed by a quick look at the Ajax JavaScript toolkit built by the author for the applications discussed in the book (the toolkit is free for the reader to use in his/her own applications!). The chapter closes with a look at a rudimentary Ajax e-book viewer application, talking through the various snippets of code used to build it. This chapter presents the reader with just enough detail to begin thirsting for more.
Part II - Building Real-World Ajax Applications
- Chapter 3 - Dynamically Loading Web Data: An XML E-Book Viewer
The author builds on chapter two by extending the e-book application to have more appealing functionality. The goal is to allow the reader to navigate through various books chapter by chapter. This chapter is the first in the book where the example applications begin shipping XML data around, so it's the first application actually using the 'X' in Ajax. The author methodically steps through a nice explanation of the XML data, the client-side Javascript and HTML, and the server-side PHP script which when pieced together form the application. This discussion is followed by a brief test of the application. The chapter closes by introducing one of the more appealing features of the book: "The Extreme Ajax Makeover." This feature discusses how the code applied to the problem at hand (in this case, viewing XML e-books) can be applied to other domains. Chapter three's makeover describes how to build a blog application using the same code used to develop the e-book viewer. - Chapter 4 - Using Ajax to Dynamically Populate Lists: A Stock Picker
The author now introduces the problem of using multiple dynamically-populated selection lists to allow users to navigate through hierarchical data. The example application is a stock picker. The user selects a type of stock (in this case, hot, cold, or safe) and is presented with a list of stocks of that type. The user can then select a particular stock and review the current quote information for that stock. As with the previous chapter, the author provides an excellent walk-through from client-side to server-side of all the necessary components to build the application. He introduces an additional interesting problem by discussing the need to retrieve the stock quote information from a web service residing at an external domain - something that client-side Javascript is forbidden to do. He presents a design pattern of using server-side scripting to act as a proxy to the client-side Javascript, whereby the Javascript requests the stock quote from the server-side PHP script, which forwards the request on to the external web service, consumes the data and streams it back to the client. Chapter four's extreme makeover describes how to build a movie database linking directly to external movie information. - Chapter 5 - Tapping into RSS News Feeds
The next project tackled by the author is the design and implementation of a basic Ajax-enabled RSS newsreader. While very little new "Ajax" content is introduced in this chapter (save the model of replacing the content of a <div> with an animated image while the news content is loading), the basic introduction to Really Simple Syndication (RSS) feeds and how they work is very helpful to the newbie. The chapter also touches on Cascading Style Sheets (CSS) for the first time in the book, although in a very rudimentary way. Chapter five's extreme makeover is a little less satisfying, as it simply describes a few ways to tweak the existing implementation - not terribly extreme. - Chapter 6 - Reading the User's Mind with Auto-Complete
This chapter brings the reader into the world of Google Suggest, one of the initial archetypal Ajax applications. The project here is a bit different, however. Rather than presenting a selection list of possible items based on the user input, this application will attempt to autocomplete the text being typed - quite similar to the behavior of most modern mobile phones when using text messaging. A key feature of this chapter is the discussion of the performance implications of the possible flurry of requests generated by an autocomplete feature, especially when the completion list is stored in a database. Chapter six's extreme makeover begins with a discussion of appropriate input types for autocomplete, followed by morphing from the historical figure biography search application implemented in this chapter to an extreme sports Google search. - Chapter 7 - Creating Responsive GUIs with Real-Time Validation
This chapter really hammers home the notion that "Ajax" isn't really about the acronym, it's, as Dion Almaer so aptly said at JavaOne 2007, "...about creating killer websites." Most of what's done in this chapter doesn't require a server-side call at all - it's simply client-side Javascript and DHTML. The author introduces a very useful toolkit that he has written for validation of various types of user input, as well as a general design pattern for using it. We're topped off with a little "true Ajax" by his demonstration of zip code validation, which is non-trivial without a server-side call. Fortunately, a free, public web service exists to lookup city, state, and other information given a zip code. The author demonstrates the use of this web service, Ajax-style, to provide validation for zip codes. Chapter seven's extreme makeover considers extending the author's toolkit to validate additional information, such as ages or NFL quarterback ratings. - Chapter 8 - A Killer Interface for Image Viewing
Chapter eight is bittersweet. While the image viewing functionality it presents is indeed "killer", I'm not so sure it was worthy of inclusion in a technical book about Ajax. The reader will quickly notice that there is almost zero code in this chapter. The author constructed a very nice Javascript framework that will pickup image links and turn them into modal dialogs, however he didn't spend so much as a paragraph telling you how it works, which was my first question. My guess is that the internals were complex enough that they would have missed the target audience. At any rate, the reader will most likely find the scripts useful. Chapter eight's extreme makeover provides a useful link to a website providing an Ajax busy indicator generator. - Chapter 9 - Presenting Information with Slick Popups
Chapter nine follows very closely in the footsteps of chapter eight. Again, the author has written a nice Javascript framework, this time for providing information popups, but provides no implementation details. There is only slightly more code in this chapter than in chapter eight. A slightly less that satisfying extreme makeover is an exercise for the reader to complete the unfinished application. - Chapter 10 - Forecasting the Weather with Ajax
Chapter ten somewhat redeems chapter nine by becoming the first chapter in the book to build on the previous one. In this chapter the reader learns how to harvest weather forcasting data from Yahoo's Weather RSS feed via an Ajax request and then present that information using the information popup framework from chapter nine. After reviewing the basics of RSS, the author demonstrates how to parse out pre-formatted HTML from the RSS feed and pass it along to the information popup script. Very nice recovery! The extreme makeover is also nice, as it presents tidbits of additional information about the Weather feed, including how to extract more detailed information about the weather, such as humidity, visibility, and barometric pressure. - Chapter 11 - Building an Ajax Shipping Calculator
Chapter eleven brings us full circle, as we finally get to implement the Ajax shipping calculator discussed in chapter one. The author provides a very useful description of the workings of the United States Postal Service (USPS)'s shipping rates web service, and then steps the reader through transforming the form data into an HTTP request to the server-side PHP script, which then transforms the data into an XML request to the web service. He then describes how to parse the shipping charge out of the resulting XML response, echo it back to the client, and then update the shipping total. Very nice. Chapter eleven's extreme makeover discusses the process of moving from the USPS test server to its production server, which allows for more input choices. - Chapter 12 - Adding an Ajax-Powered Rating System to Your Site
Chapter twelve serves as an interesting capstone to the reader's journey through Ajax. It presents a nice framework for introducing the ever popular five-star rating system to your applications. Once again the internals of the framework are hidden, but in this case the design of the framework is explained should the reader desire to tinker with the code. The reader walks away with a rather powerful and self-contained rating system that could be applied to any collection of items having unique ID's. The extreme makeover discusses the application of the rating system to other applications, and then describes the use of a database to store the ratings rather than an XML data file (thought I have to say, as one who love agile techniques, the XML file is the simplest thing that could possibly work).
Part III - Appendices
- Appendix A - The Past, Present, and Future of Ajax
This appendix presents a brief but interesting look at the technological changes in browser technology that eventually led to what is now Ajax, followed by the necessary nod to Google Maps as the application that started the modern day Ajax boom. It closes with a very pragmatic look at the future of Ajax, including the wise admonition not to attempt to use Ajax as the proverbial "silver bullet". - Appendix B - A Quick and Dirty XMLHttpRequest Reference
This appendix provides a nice API reference to the XMLHttpRequest JavaScript object. Here are the nuts and bolts for which many readers may have been waiting. - Appendix C - Using the Live Linux CD
This appendix provides useful helps for getting the included Live Linux CD up and running in a variety of environments. My personal preference was installing it into a VMWare Fusion virtual machine on Mac OS X, which worked like a charm the first time I tried it.
Relevance of Material
The book is EXACTLY what it claims to be. Those looking for a full theoretical and/or "nuts and bolts" discussion of Asynchronous Javascript and XML (AJAX) need look elsewhere. Those looking to quickly add interesting and useful Ajax features to existing web sites and applications, without getting bogged down in the details, will be quite at home. This is a HOWTO book, not a WHY book. Looking at the book through the eyes of those the author was targeting, I have to say that he hit a home run. I could easily see how I could add the various features he discusses to my own applications. That being said, a few of the chapters (most notably eight and nine) erred a little too far on the side of hiding the details for my taste.Resources
Book website: http://www.informit.com/store/product.aspx?isbn=0132350084&rl=1- Login or register to post comments
- 1140 reads
- Flag as offensive
- Email this Book Review
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






