Wednesday, April 2nd, 2008
Category: Books
, Book Reviews
Back in February, I reviewed the first half of Shawn M. Lauriat’s “Advanced Ajax: Architecture and Best Practices” (Prentice Hall, 2008, 360p). The first four chapters of Lauriat’s book, which focused almost exclusively on client-side technologies, impressed me considerably. But it’s taken me several weeks to get through the remainder of the book, and there’s one reason why: PHP.
The server-side portion of “Advanced Ajax” uses PHP code to illustrate its many and varied lessons about Ajax architecture. It’s not that I have anything against the popular web-development framework and scripting language. It’s just that, after spending my career in the ASP Classic and JSP trenches and slowly ramping up on Rails in the last year, I’m not the ideal target audience for these code samples. Adding “PHP” to the title of the book might have limited its potential audience, but it also would have been more accurate.
That said, there’s a lot of value here for adherents of any server-side framework. Lauriat discusses each topic from a general perspective before diving into the code. The technical approach to a given problem would obviously differ by framework, but the high-level approach wouldn’t. If you don’t mind skimming past the content that doesn’t apply to you, Lauriat’s advice about developing stable, scalable, accessible and secure Ajax applications transcends framework allegiance.
more…
Tuesday, February 12th, 2008
Category: Books
, Book Reviews

Because Ajax moves so much application logic from the server to the client, it forces many developers to master a wider range of web technologies than ever before. To work effectively on Ajax projects, front-end developers have to concern themselves with database performance, business logic and other server-side concerns. Back-end and middleware developers, meanwhile, have to make friends with XHTML, CSS, JavaScript and a wide range of browsers. Sure, it’s possible to develop Ajax apps in a siloed team environment. But it’s not the easiest way, and it rarely provides the strongest results.
Shawn M. Lauriat’s “Advanced Ajax: Architecture and Best Practices” (Prentice Hall, 2008, 360p) bridges the gap between developers with exclusive client- or server-side skills. By exploring tools, technologies and best practices for every layer of the Ajax programming model, this solid new programming manual promises to plug the holes in any developer’s resume. Lauriat’s tops-to-tails approach offers something for almost any developer, but it also guarantees most readers will find some sections remedial. As this two-part review will demonstrate, that’s not necessarily a liability.
more…
Wednesday, January 30th, 2008
Category: Ajax
, Security
, Book Reviews
Brian Dillard of Agile Ajax has a review of Billy Hoffman’s new book “Ajax Security“. If you’ve not picked this book up, you really need to. It’s received rave reviews and is quickly becoming the must-have security book for client-side development. As Brian can attest:
The book itself, of course, documents dozens more specific security vulnerabilities - as well as best practices for protecting your application against them. I said it before, and I’ll say it again: “Ajax Security” is required reading for any professional software engineer.
Be sure to read Brian’s review and be sure to get the book.
Wednesday, January 16th, 2008
Category: Books
, Book Reviews

Reviewers overuse the phrase “required reading,” but no other description fits the new book “Ajax Security” (2007, Addison Wesley, 470p). This exhaustive tome from Billy Hoffman and Bryan Sullivan places the specific security concerns of the Ajax programming model in historical perspective. It demonstrates not only new security threats that are unique to Ajax, but established threats that have gained new traction in the Web 2.0 era. It then details both the specific technical solutions and - more importantly - the mindset that are necessary to combat such threats.
Because so many developers have historically overlooked the importance of security, the authors approach their topic for what it is: a remedial subject. They take pains to explain the basic mechanisms by which hackers have exploited insecure web applications over the last decade: cross-site request forgeries, denial of service attacks, cross-site scripting and SQL injection. Then they explain how those mechanisms have changed thanks to the rise of xmlHttpRequest, public APIs, mash-ups and aggregators. If you’ve ever read a Douglas Crockford rant about the “brokenness” of the web security model and wondered why the guy was such an alarmist, Hoffman and Sullivan are only too happy to provide you with a much-needed wake-up call.
More…
Wednesday, November 7th, 2007
Category: JavaScript
, Prototype
, Books
, Book Reviews
, Scriptaculous
, Announcements
This is a big day for Protoscript friends. The triple release. The big one. This post is a long one two as it discusses:
Prototype 1.6
They cleaned up, and 1.6 is a really nice piece of work. A lot of little nit-picks are now solved, and you are left with the lean mean machine that you know and love.
Highlights
- Ajax transport objects are now automatically wrapped in an Ajax.Response object.
- Ajax.Response includes support for accessing JSON response bodies as JavaScript objects via the responseJSON property.
- The class API now includes full support for inheritance and superclass method calls. (See Mislav’s tutorial for more info.)
- Class objects now have an addMethods method for adding instance methods after creation.
- Elements can be created easily with the new Element(…) syntax.
- Element#insert provides a unified API to DOM element and HTML fragment insertion.
- Element#select is an alias for getElementsBySelector and is now the preferred way to find elements by class name.
- Element#wrap lets you easily wrap an element inside another element in place.
- Enumerable methods on Array are now backed by native Array#forEach implementations when possible.
- Enumerable now has aliases for equivalent JavaScript 1.6 Array methods, and support for JavaScript 1.6’s context parameter for automatic callback binding.
- Enumerable#grep now calls the match method on its first argument, so you can use it to e.g. filter an array of DOM nodes by CSS selector.
- Event objects are now automatically extended with instance methods, so you can write e.g. event.stop() instead of Event.stop(event).
- Prototype’s event API now supports firing DOM-based custom events with Element#fire.
- The new dom:loaded custom event fires when the entire document has loaded and is ready for manipulation.
- Function#curry allows for partial application of function arguments.
- Function#wrap facilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
- Function#delay delays invocation of the function by the given number of seconds.
- Function#defer schedules the function to run as soon as the interpreter is idle.
- The Hash API has changed, and you must now use Hash#get and Hash#set instead of directly accessing properties on Hash instances.
- String#interpolate is a shortcut for instantiating a Template from the string and calling evaluate on it.
- Object properties can now be used in template replacement strings.
Script.aculo.us 1.8
This is the last release before 2.0 comes out and features:
- Complete rewrite of Ajax.InPlaceEditor and Ajax.InPlaceCollectionEditor
- Full CSS inheritance in Effect.Morph
- New core effect: Effect.Tween
- Sound: play mp3 files for sound effects; uses native playback on IE and available plugins whereever possible
- Duration and distance options for Effect.Shake
- Performance improvements
- Tons of bugfixes
The Book (Reviewed by Stu Halloway)
The skinny: If you develop with Prototype and Scriptaculous, you need
this book.
Prototype and script.aculo.us: You Never Knew JavaScript Could Do This! is a long book, by Pragmatic Press standards. At first glance,
this might seem doubly odd, since the libraries themselves are quite
small, totaling only in the 100s of KB. But before I even opened the
book, I hoped that the length might be justified, for two reasons:
- Prototype and Scripty (hereafter P&S) are packed with dense,
expressive, beautiful code, and they can do far more than their size
might suggest.
- Along with several other Ajax libraries, P&S embody a modern
JavaScript style that embraces functional programming. This new style
is not well covered in the JavaScript books currently in print (as of
November 2007), so to learn P&S you also have to learn to think about
JavaScript in a new way.
Once inside the book, I was delighted to find that both of my hopes
were addressed. Porteneuve dives straight into the deep end,
embracing JavaScript’s functional style immediately in Chapter 2 and
never dumbing down the example code. (Don’t worry, there are forward
and backward references to help you along. This is especially nice if
you are reading the electronic copy of the book.) You may need to
read some sections of this book multiple times, and that is a good
thing.
The coverage of both Prototype and Scriptaculous is thorough. Of
course the marquee features receive due attention: Prototype’s
Ajax.Request and Scriptaculous’s Effects each have their own
chapters. More interesting to me is the thorough coverage of the less
visible parts:
- Prototype’s functional capabilities are significantly enhanced for
the 1.6 release. Chapter 4 shows how to use curry, bind (including
multiple argument invocation), delay, and defer. You can even do some
lightweight Aspect-Oriented Programming (AOP) with the new wrap method.
- Chapter 7, “Playing with the DOM is Finally Fun”, nicely mixes
tutorial and reference. The Staff Manager example motivates each
section, but each individual section also acts as a reference for a
set of DOM extensions.
- The Event mechanism has been rewritten and enhanced for Prototype
1.6. Chapter 6 covers the new unified event handling. Porteneuve
motivates the event model by contrasting three approaches: the IE
way, the standards way, and the Prototype way. With 1.6, portability
improves again with synthetic events that fill gaps in the browser
event model, e.g. dom:loaded. You can even fire and respond to your
own custom events.
- I have been using Scripty for years and I never even noticed the
sound API (Chapter 20).
Of course, no reviewer feels complete until a few nits have been
picked. So here are a few:
- Porteneuve embraces Prototype’s approach to JavaScript and the web
(as do I). That said, there are many other approaches. It would be
great to have an overview of the philosophical differences that set
P&S apart from other JavaScript libraries.
- The book’s style is casual, even by Prag standards.
- Prototype and Scriptaculous are a rich buffet, and the book
documents nearly every bite. Sometimes the book could be more
opinionated about the menu. For example, I hate the $break feature in
Prototype. Maybe Porteneuve does too–the example is certainly
contrived.
These flaws are relatively minor. Overall I was impressed by the
amount of information in the book. I have been using P&S for years,
and I learned something new in almost every chapter.
For years, developers at software conferences have asked me “What is
the best way to learn Prototype and Scripty?” Until today, my answer
has always been “Read the source code.” Not any more. If you are
building applications with P&S, you need to read this book.
Friday, August 10th, 2007
Category: Book Reviews
, jQuery
My colleague Brian Dillard has written a review of Learning JQuery:
Having spent most of the Ajax era at a large dot-com writing custom JavaScript backed by Prototype and some really solid internal libraries, I’m astounded by the staggering number of competing frameworks that have been quietly chugging along while I was busy elsewhere. It’s time to play catch-up. Helping me in that mission are Jonathan Chaffer and Karl Swedberg, authors of the new “Learning jQuery: Better Interaction Design and Web Development with Simple JavaScript Techniques.” The title’s a bit of a mouthful, but this beginner’s tutorial offers the same elegance and simplicity as the jQuery JavaScript framework itself. Assuming a solid grasp of basic UI technologies (XHTML, CSS and JavaScript) on the part of their audience, Chaffer and Swedberg dive right into the basics of using jQuery to speed development of RIAs.
There’s a lot to like about jQuery the library:
- The CSS selector-based DOM traversal provides a single, unified method of manipulating your markup and data. It’s less flexible than Prototype’s grab bag of DOM methods, but it’s easier to master. All of the major frameworks are scrambling to optimize their DOM traversal methods for speed and scalability, so it will be interesting to see how jQuery evolves.
- The crazy method-chaining allows simple, elegant DOM manipulation. Grab a node reference, change some visual properties and add behaviors - all on a single line.
- The stripped-down base library and plug-in framework offer an attractive solution to feature bloat and gigantic code footprints. The base jQuery library provides the underpinnings, but the plug-ins provide the bells and whistles one at a time.
- The organization of the jQuery object itself keeps the global namespace free and other libraries working properly. jQuery doesn’t rewire core JavaScript objects, either, so it plays well with legacy code written in POJ.
More…
Monday, July 23rd, 2007
Category: Book Reviews
, GWT
Any time a hot technology comes along — and GWT is certainly white-hot — publishers compete in a mad scramble to get the first books out the door. Often quality suffers. I am happy to report that GWT in Action is a strong effort that doesn’t seem to suffer from this quality problem. (That isn’t to say there aren’t any errors and omissions in the book, just no obvious ones that I’ve found in my reading of it.) Instead, the book offers a solid, learn-by-example approach to understanding the Google Web Toolkit.
This learn-by-example approach, tied together through the development of a dashboard application over the course of several chapters, strikes, I think, the right balance for a broad audience. This is not the reference “bible” for GWT, though it does contain more reference material in one place than any other source so far, so you’ll have to wait for that sort of reference work. But for anyone wanting to get a jump start on GWT, start developing applications, and understand what all the fuss is about, I heartily recommend this book.
The book is organized into 17 chapters, split into four parts: Getting started; Building user interfaces; Advanced techniques; Completing the understanding. So, on to what’s in the book, chapter by chapter:
- Introduces you to the central ideas of GWT: compiling Java in JavaScript and debugging in Java. Does a good job of touching on most of the features of GWT — widgets, internationalization, JRE emulation library, RPC, browser history, etc. — and illustrating them with code samples. Finishes off with a complete client-side (no RPC) tic-tac-toe example app.
- Things slow down a bit here, as the authors delve into the organization of a GWT project and the details of the GWT development cycle. I’m torn on whether this chapter could have been illustrated more clearly with an example application, rather than just by enumerating the steps and components and diagrammatically illustrating the work-flow. The information that’s here is solid and correct, but the approach seems to conflict with the learn-by-example used so well in the rest of the book.
- Begins the process of developing the Dashboard application — essentially a web desktop or portal with draggable component apps. It makes concrete the more abstract development life cycle notions of the previous chapter. At the end of this chapter you have a skeleton application with menus,
a trash icon and some basic CSS styling, and you will have run it (and debugged in Eclipse for hosted mode) in
both hosted and web mode. This chapter attempts to instill good behavior by adding i18n (”internationalization” with the 18 letters between the “i” and the “n” omitted) at the very beginning. That way if you leave it our of your apps, you have no one to blame but yourself. You’ll also have a good understanding of the major project files: the HTML file, the EntryPoint, and the module XML file.
- The start of Part 2 of the book which introduces GWT “widgets” — in short, GUI components. Dissects their dual nature as Java objects and DOM elements and introduces the basic GWT widget set. Covers several common GUI and Web concepts, such as DOM events, focus, keypresses, etc. Shows two different ways of developing custom widgets — one from scratch by manipulating the DOM and the other, the PNGImage to support transparent PNG’s in IE6, by extending an existing widget class. Finishes off by building the first two custom widgets for the dashboard application, the TwoComponentMenuItem and the ToggleMenuItem. The full details of building the PNGImage class, using GWT’s technique of deferred binding to handle browser differences, is split between here and Chapter 15. Small nit: I think the concept is important enough to have merited a section of its own in this chapter or the other.
- Presents the basic concepts of GWT panels — the containers that hold widgets and other panels. If you know Swing, this will all seem pretty familiar, in particular DeckPanel, FlowPanel and DockPanel should seem familiar. (It is interesting to note that in GWT, layout is specified through inheritance (Is A FlowPanel), while in Swing it is a pluggable behavior (layout manager).) Of course, remember to pay no attention to the HTML Table behind the curtain, at least not if you want your code to keep working when the implementation changes. The chapter finishes off by extending DialogBox to a DashboardPanel that can be used and manipulated in a multi-window interface (or MDI).
- Focuses on Events, both Browser/DOM events and it’s custom Widget events. This is a long chapter (over 50 pages) and covers lots of territory. If you already know your way around Java and the various kinds of Listeners, you’ve won a quarter of the battle, but you may want to brush up on the browser side of the equations a little bit before reading it (see here, here and here). Not that the chapter doesn’t do a good job of presenting the material, but sometimes you need to have a firm grasp of one topic before combining it with another, and I think this is definitely one of those times. The chapter finishes off by implementing drag-and-drop for the Dashboard app, combining the widget knowledge from the previous two chapters with your new understanding of events.
more…
Monday, April 30th, 2007
Category: Book Reviews
, GWT
A mini book deserves a mini review, and so it is with the “Digital Shortcut” from January 2007 entitled Google™ Web Toolkit Solutions (Digital Short Cut): Cool & Useful Stuff. The 112 page PDF goes further than any of the free tutorials out there in that it develops two non-trivial applications using GWT: a Yahoo! Trips app that uses proxied Yahoo web services, and an Address Book, that makes use of Hibernate persistence through RPC.
The applications are non-trivial in that they tackle complex use cases, backend processing, web service, backend persistence and the integration of third party Javascript frameworks — all aspects of GWT application development that are of great interest to serious developers. (Source code available for download.) In order, the chapters cover the following:
- Chapter 1 covers what must already be fairly familiar to most GWT developers — making an RPC call to a backend servlet. This chapter, however, does an exceptionally good job of explaining the why and how of GWT RPC in exhaustive detail. The Yahoo Trips application is used to illustrate how to proxy an RSS feed.
- Chapter 2 shows how to integrate third party Javascript libraries with GWT. In this case Scriptaculous is used to provide an effect in the Yahoo Trips application to the panel containing the search results. The chapter focuses on two ways to incorporate scripts in the app — simply including script tags in the application html file, and GWT script injection, i.e. through the GWT config file.
- Chapter 3 shows one way of how to implement drag and drop with GWT, using a fairly OO approach. The code seems pretty reusable and useful. Again, the Yahoo! Trips app is used.
- Chapter 4 shows how to bring GWT into the mix. Most of it is old hat for experienced Hibernate hands, but the example does work through implementing a sort of remote DAO using the GWT RPC. It’s always good to see how that is done, even if it looks simple on paper. The Address Book app is used for this example.
- Chapter 5 shows how to use ant to deploy your apps to Tomcat. I assume most everyone is using Googlipse or some non-free alternative, but writing ant files for automated build environments is still a useful thing to know.
- Chapter 6 illustrates the use of popups and “deferred commands.” Popups are obvious (modal and modeless dialogs); deferred commands are a way of giving focus to widgets that have not yet been displayed. I really haven’t seen good treatment of this aspect of GWT programming elsewhere. Uses the Address Book app for this example.
Over all, the book doesn’t skimp on explanations and code samples and is written in a clear style. It doesn’t address unit testing with JUnit, but I suppose you can get that information elsewhere. For those of you who like to learn by doing, this is a decent tutorial (and worth the $10 price tag) that can tide you over until the bigger GWT tomes come out.
Thursday, March 1st, 2007
Category: Book Reviews
Despite its title, Beginning Javascript with DOM Scripting and Ajax by Christian Heilmann is not for those just starting out in web development. What it is, is a great resource for those that already have some experience coding dynamic web sites. The book explores the principals of DOM scripting (using the Document Object Model) to build dynamic pages the right way- with standards compliant code that maintains the separation between content and presentation. The early chapters are devoted to giving the reader a quick overview of Javascript. chapter one takes a look at basic syntax and simple functions. Chapter Two covers datatypes and conditionals. If you don’t know Javascript, you might want to start with something else, such as Beginning JavaScript Second Edition by Paul Wilton. Some of the concepts and techniques used later on in the book require greater familiarity with Javascript than a begginer would have.
Read more of the review here.
Thursday, January 11th, 2007
Category: Book Reviews
Jason Lee has posted a book review on Building Ajax JSF Components.
The chapter begins by making the grandiose claim that “JSF and AJAX are a perfect match.” The authors then attempt to back up their claim by showing how JSF’s lifecycle phase management helps implement components that use AJAX very cleanly, especially from the component users’ perspective.
After a brief introduction to how AJAX works, the authors implement an employee directory search page using hand-written AJAX code and a servlet (no JSF involved at all). This component, in a fashion similar to the myriad of autocomplete components available, allows the user to type in the name of the desired employee and see, as he types, a list of possible matches appear in a table below the text field.
Complete code for this component is shown, demonstrating what many of us already know: there’s much to be done on the both client and server sides to make AJAX work. It also highlights well one of the downsides of Ajax: there’s a fair amount of work a page developer must do to set up the Ajax environment.
Taking that example, the authors then reimplement the same component as a JSF component. For those new to JSF or unfamiliar with writing JSF components, some of the inner workings of the component can seem a bit overwhelming, but the advantage for those that would like to consume this component is hard to miss. The requirement for reuse goes from copying several JavaScript files into one’s project, adding the script includes, and writing all the (X)HTML markup to display the component to adding one JAR to the project and adding two lines to the markup: the tag library declaration, and this line:
And, if that one example were not enough, Schalk and company go on to implement a spell check text area component for JSF. This component “extends HtmlInputTextArea and provides a simple Ajax-enabled spell-checking facility,” which can be used with a single line of code like this:
XML:
-
-
<jcr :spellCheckTextArea cols="30" rows="15" value="#{user.interests}" />
-
Monday, November 27th, 2006
Category: Book Reviews

This is a review of Pro Ajax and Java Frameworks by Nathaniel T. Schutta and Ryan Asleson. This book seeks to give the experienced developer of Java web applications the knowledge necessary to add Ajax to their webapps. This is another Ajax book that goes broad rather than deep. Instead of investigating one or two frameworks, it delves into more than a half dozen, both Javascript and Java.
Quick summary: Chapters 2, 3 and 5 are the strongest in the book with useful information on tools, Javascript libraries and enhancing Struts applications with Ajax. The other chapters are not as strong and spend too much time covering old ground.
The book is divided into two parts. Part 1 is an introduction to a variety of Javascript and Java Ajax libraries and frameworks. Part 2 shows how to integrate those libraries and frameworks into existing Java web frameworks such as Struts and JSF. One place that this book differs from other Ajax books is that it doesn't have a chapter introducing the reader to the browser technologies that comprise Ajax. It doesn't dwell on the basics of Javascript, DOM and CSS. It expects you to have already read the Apress books on those topics. Instead, chapter 1 covers what I would call best practices and patterns -- autocomplete, partial page update, draggable DOM.
Read more of the review here.
Monday, November 6th, 2006
Category: Book Reviews
At a quiet time during my 40th birthday extravaganza, I finally had the chance to finish reading Practical Ajax Projects with Java Technology by Frank Zammetti from Apress. I've read enough good, hands-on Apress books by now to get a warm and fuzzy feeling anytime I see their distinctive bumble bee black and yellow covers, so I came to this volume hoping to find an Ajax treatment in that mold. The result isn't an unqualified success in that regard -- it goes broad rather than deep -- but if you're an experienced Java developer looking to get caught up on some of the Ajax developments of the last year and a half, this book is for you.
The book assumes a good foundation in server-side Java development, but little or no experience with the technologies that make up Ajax. Part 1 of the book, which is comprised of Chapters 1-3, is an excellent review of Ajax technology and architecture along with a basic review of Java webapp development. Part 2 consists of seven chapters, each of which develops an Ajax application.
Read more of the review here.
Thursday, August 31st, 2006
Category: Book Reviews
The latest edition of the venerable tome JavaScript: The Definitive Guide is a sorely needed update. I guess it took Ajax, Web 2.0, and an intervening five years to revive interest in in this quirky client-side language. The fourth edition, while still providing a good formal specification of the language, had fallen woefully out of date both with some of the new features introduced in recent browser versions and in terms of practical examples of how JavaScript is being used to enable Ajax and Web 2.0 applications.
I don't mean to give a full review of a thousand plus page book here. Rather, I just want to focus on the chapter that covers client-side persistence. In the fourth edition, the corresponding chapter only discussed "cookie scripting." While this chapter does talk about cookies, it delves into a number of other options for persisting data on the client.
Unfortunately, for a book that describes itself as the "definitive guide", it only discusses three options for persistence: cookies, IE userData persistence and Flash SharedObjects. This coverage is far from definitive. In fact, Brad Neuberg in his discussion of dojo.storage enumerates seven different client-side storage mechanisms:
- Cookie Storage Provider - uses cookies to persist the hash table
- Flash Storage Provider - uses Flash's SharedObjects to persist data
- ActiveX Storage Provider - uses COM's File APIs to persist data
- XPCOM Storage Provider - uses XPCOM's File APIs to persist data
- Form Storage Provider - uses the text autosave features of a hidden form to save transient data (the Really Simple History library uses this trick)
- WHAT WG Storage Provider - uses native browser persistence to store data, as defined by the WHAT Working Group.
- IE Storage Provider - uses IE's proprietary abilities to store up to 60K of data.
Maybe this is just a sign that the use of JavaScript has grown so far beyond what was common or even thinkable in 2001 that it is simply isn't possible to write a definitive guide, at least not in a thousand pages. Would you buy a book called "Java: The Definitive Guide?" Probably not.
What is there -- the discussion of Flash SharedObjects and IE userData persistence -- is pretty brief in comparison to the exhaustive treatment of cookie persistence. It does give you a basic description and enough code samples to get you started, but a cookbook it is not. The section on persistence alternatives has the feeling of an afterthought -- something shoehorned into the book relatively late to address Ajax and Web 2.0. In fact, many parts of client-side portion of the book have that feel.
I think the book is still worth buying as a language reference, if only for its treatment of closures and object creation, but for now you'll have to look online for more detailed, exhaustive, and "definitive" treatment of many topics.
Monday, August 14th, 2006
Category: Book Reviews

On the Smart Pad Blog today, there's a book review for the Packt book "Ajax and PHP: Building Responsive Web Applications" by Diane Cipollo.
This book assumes a working knowledge of PHP, XML, JavaScript and MySQL and that you have PHP, MySQL, phpMyAdmin and a server such as Apache installed on your computer. In this book the authors, Cristian Darie, Bogdan Brinzarea, Filip Chereches-Tosa and Mihai Bucica, teach their readers how to add Ajax client-side features to PHP driven web applications.
She basically just gives a summary of what the book covers - everything from the most basic "what is Ajax and how does it work" all the way out to various projects that the book walks you through. These include an Ajax chat application, Google Suggest-style search functionality, and an RSS reader. She also mentions the supporting site provided by Packt for the book as well.
Monday, August 7th, 2006
Category: Books
, Book Reviews
, Design

Digg this review!
Christian Gross' Ajax Patterns and Best Practices is a quality book for the intermediate to advanced ajax programmer who is looking to expand their skills. This is definitely not a beginner's introduction to ajax, as once you get past the first three chapters or so Gross dives into some heavy duty patterns for difficult problems in ajax. The book suffers from a lack of editing and a few curious technical remarks, but overall it does a good job of covering ajax patterns and practices. Gross is obviously a fan of REST and XML, so your views on this book might depend upon how much you agree with his technical choices.
Chapters one and two cover the basics of the XHR object and using the factory pattern to abstract away browser differences for the object. Chapter three covers "Content Chunking", Gross' term for what he admits is core to ajax - an event leading to an asynchronous request with then responds with some sort of content to inject back into the document. Chapter four covers caching practices, and five covers the "permutations" pattern - ie separating the URL resource from the representation. Six covers "decoupled navigation" (ie seperating the event triggering/handling from the business logic they fire), seven covers switching between states seamlessly, and eight covers the even popular "persistent communication" (ie polling) pattern that many of you may have seen yesterday in coverage of the WWDC. Nine covers workflows in ajax with the "state navigation" pattern, ten is "infinite data" (see the scrollbar at live.com), and eleven covers treating remote services as the model in MVC via REST.
So there is a lot of content here, and the code examples are done well for the most part. The code used in the book was extracted later into a framework, so its nice to see the code being used for something beside toy examples. Server side examples are in Java or C# with a few exceptions, with all of the serialization in XML with some XLST examples also shown. The javascript code seems to follow some strange conventions, with TitleCase function names for example. There are no third party frameworks used or covered.
Regarding serialzation, Gross has this to say about XML vs everything else:
Many people might think that XML has its problems and have proposed protocols that are better. Frankly, I think that is plain wrong...Therefore, when writing your own Ajax and REST applications, stick to XML.
While I certainly see Gross' point about the benefits of interoperability with web services when using XML, he fails to mention how sites like Yahoo and del.icio.us are offering their data in JSON. If your app will only ever talk to del.icio.us, for example, it might not be best to go with XML. There are also the cases where you have complete control over the services, for an intranet app for example, and you may go with JSON or YAML for developer friendliness. I think at least discussing serialization in the context of a simpler app that doesn't talk to web services would have been helpful for developers who aren't writing the next big XML mashup.
Besides that nitpick, this book will be great for someone who wants to know some of the big pitfalls of creating large scale ajax apps, and ways to sidestep them. The only other significant fault is the editing, with one too many awkward run-on-sentences. The overall tone is conversational and easy to follow once you get past that. The patterns covered are very useful, particularly the caching pattern and the different ways of handling transitioning and transforming state. Recommended, particularly if you are doing a lot work with REST/XML and multiple web services. If you can only own one Ajax book - get Ajax in Action - if you own two, make Ajax Patterns and Best Practices your second choice.
Friday, June 23rd, 2006
Category: Ajax
, Book Reviews
Books can be the lifeblood of any technology, but only if they're good. To that end, WebReference.com has posted a new book review of Sams Publishing's "Ajax in 10 Minutes" book to share if they thought it was up to the task.
Not being familiar with the Sams "Teach Yourself in 10 Minutes" series, I was more than a bit skeptical when I first saw the title of this book, "Ajax in 10 Minutes." Considering that Ajax encompasses the use of JavaScript, XML, XSLT, (X)HTML, CSS, PHP, and the DOM, it seemed pretty obvious that you couldn't learn all of that in ten minutes. But, as it turns out, that's not what the title means at all.
They