- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
Book review: Advanced Ajax by Lauriat (Part 2 of 2)
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.
Topics: Ajax Development, Books, Review
Book review: Advanced Ajax by Lauriat (Part 1 of 2)

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.
Topics: Ajax Development, Books, Review
Ajax security surprises: web-aggregators, offline applications and frameworks

I'm still absorbing the densely packed information from "Ajax Security," the first-rate book by Billy Hoffman and Bryan Sullivan that I recently recommended in these pages. Here, in no particular order, are three of the most surprising lessons imparted by Messrs. Sullivan and Hoffman:
Web aggregators and SSL
This is probably a great big "duh" to some developers, but web aggregators such as iGoogle and NetVibes often compromise the security of otherwise SSL-encrypted web applications when funneling content from them to your personalized homepage:
Now, consider what happens when you use a Gmail widget on an aggregate site like NetVibes. Sharp-eyed readers will notice the URL for NetVibes ... is http://www.netvibes.com. This is not an encrypted connection! NetVibes sends user data in the clear from the aggregate to the user.... NetVibes makes an SSL connection to Gmail, and then NetVibes degrades the level of security by transmitting the data over an unencrypted connection. Our attacker ... can steal the data much more easily now. NetVibes is not providing the same level of security that a user would receive if he accessed Gmail directly. This situation is not unique to NetVibes and Gmail.... At the time of publication, every major aggregate Web site the authors examined downgraded security on data from secure sources. [emphasis theirs]
Topics: Best Practices, Books, Review, Security
Review of ‘Pro Ajax and Java Frameworks’
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.
- Chapter 2 covers the tools of the Ajax development trade -- IDE's, debuggers, HTTP monitors, logging, testing, etc. -- and provides links to where these tools can be downloaded. While those tools that are mentioned -- Venkman, Selenium, Firebug -- are all solid and useful, there is usually only one tool in each category. For Javascript editing, Aptana for Eclipse deserved a mentioned, as did JSMin and Packer for Javascript compression. While Venkman is a great tool for debugging and profiling in Firefox, the various solutions for IE are not addressed. Still, the tools are all solid choices, and the tutorial alone on how to debug Ajax with Selenium is worth the price.
- Chapter 3 looks at three (four if you count Scriptaculous, which is based on Prototype) Javascript Ajax libraries -- Prototype, Taconite and Dojo. Each library is treated with some brief but useful examples along with a short example on how to use them to integrate with a servlet or JSP on the server. As always seems to be the case, Dojo seems to get short shrift. In fairness, dealing with Dojo is probably a worthy subject for an entire book of its own.
- Chapter 4 looks at Direct Web Remoting (DWR) and AjaxTags. The chapter consists mostly of the basic syntax and workings of the frameworks and a few simple examples.
Part 2, as previously mentioned, builds on what the reader has learned about the preceeding Ajax frameworks and libraries and looks at integrating them into existing non-Ajax web application frameworks.
- Chapter 5 is probably the most useful chapter in the book. For those maintaining Struts applications -- and there are a lot of them out there -- it provides a detailed blow by blow on how to turn a simple Struts-based form validation into an Ajax powered on using Prototype. This example doesn't address all possible uses of Ajax, but it does give you a clue on exactly where to splice the Ajax magic into the Struts infrastructure.
- Chapter 6 looks at the Tacos (Ajax enabled) components of the Tapestry framework. This is the first chapter that seems to voilate the book's guiding principle: it spends the lions share of its length in explaining the workings of Tapestry rather than focusing on how to add Ajax to it.
- Chapter 7 combines DWR and the Spring framework to develop a simple inventory control system. Again. lots of time is taken in explaining Spring and relatively little in showing how to add in the Ajax with DWR.
- Chapter 8 shows two ways of adding Ajax to JSF, one with a roll your own approach using raw XHR and no libraries. The other using some Ajax JSF components from the Apache Tomahawk project. Again, too much time is spent explaining vanilla JSF and not enough with the Ajax enhancements. I would have like to see more written on both using and developing Ajax components, since the component is, after all, the heart of JSF.
Summary: As previously mentioned, this book goes broad rather than deep in picking out more than a half dozen frameworks and libraries. Also, the examples throughout the book are little more than snippets, not applications that would demonstrate the development of a full Ajax app. Still, there are a wealth of tool and library tutorials and Ajax conversion best practices in it to make it a valuable reference for anyone looking to enhance a legacy webapp with Ajax.
Mini review of “JavaScript: The Definitive Guide, 5th Edition”
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 the 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 SharedObjectsand 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 the 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.
Topics: Books, Javascript, Review
AJAX Framework Browser Compatibility Matrix
Musing from Mars has published an update of his Ajax Framework Browser compatibility review. It's not a framework review but rather a rating of how compatible these frameworks are with all of the major browser versions. His grading scale is simple: the more versions of browsers you support, the better. See below.
A - IE 6, Firefox 1.0, Safari 1.2, Opera, Other DOM-compliant
B - IE 6, Firefox 1.x, Safari 2.x, Other DOM-compliant
C - IE 6, Firefox 1.x, Other DOM-compliant
D - IE 6, Firefox 1.5
E - IE 6
I'm not sure I agree with his grading scale (what grade does a framework that only supports Opera get?), but no matter. Some information is better than none. Some of the highlights? Echo2: A; ZK: D+ (Safari problems and insufficient testing); Tibco GI: E (tied to IE with very lame Firefox support).
Topics: Ajax Frameworks, Echo2, Frameworks, Javascript Libraries, Review, ZK
Echo2 vs GWT
Back on June 6th I made a note of this post by Echo2 creator Tod Liebeck at The Server Side, entitled Comparing the Google Web Toolkit to Echo2, but never got around to blogging about it. Tod gives a fairly succinct description of both GWT and Echo2:
GWT's defining attribute is the Java-to-JavaScript compiler. This compiler allows you to develop the web interface to your application in Java, then compile it to JavaScript. GWT limits the developer to a subset of the Java 1.4 libraries. GWT applications can be served by any web server, such as Apache, without the need for server-side processing.
Echo2 applications are compiled to Java byte code and run on a Java server. Their Java code is executed by Echo2's "Web Application Container" layer, which sits atop a Java Servlet. On the web browser, the Echo2 "Client Engine" communicates user input to the Web Application Container via AJAX requests, with the server responding with directives to perform incremental updates to the state of the client web browser.
He goes on to analyze other points of comparison, including architectural, performance and legal issues. A good comparison by one of the AJAX worlds leading developers.
One thought here is that many folks have held out a GWT as a tool for writing widgets for other frameworks such as ZK and Echo2. I've been going through the Javascript infrastructure of GWT and it seems there's a whole lot of plumbing that stands in the way of making this a reality. More on this later.
Topics: Ajax Frameworks, Ajax Performance, Application Architecture, Frameworks, Google, GWT, Review
ZK - Documentation & Tools
Documentation
The quality of the ZK documentation is very high by Open Source standards. The documentation includes:
- A 13 page PDF Quickstart guide - shows how to set up the demo application and a hello world app.
- A 169 page PDF Developer's Guide - steps you through the ZK framework with lots of small examples illustrating components and concepts.
- A 43 page PDF Developer's Reference. Documents component properties and behaviors. This document is only about 40% complete.
- A 1 page PDF Executive Overview.
- A 16 page PDF Product Overview - gives information on the motivations behind ZK and the architecture of the product.
The reference guide will need to be completed, otherwise developers will be guessing at specifics of components and the ZUML. Also, the documentation on CSS and "molds," i.e. the templates for components, is spotty. This will make it difficult for developers to change the look and feel in any significant way.
Tutorials
While there is a ZK demo application that shows off various components, there appear to be no tutorials or example/reference applications available to the would-be ZK developer. There is a wiki with a how-to/cookbook page, but just like the developer's guide, it consists of short examples, not a substantial application. There is also a port of a struts application over to ZK, but it seems to make use of so little of the AJAX capability of the framework that it can't really be considered a tutorial or reference app. For now the forums are probably the best source of information and support. Also, there is a "small talks" section of the project site that has some bits of information on integrating ZK with things like the Spring Framework.
Usability
Overall the framework is a joy to use. The ZUML makes it easy to do quick iterations -- edit, test, edit, etc. -- without a long compilation step. The ZUML is also easy enough so that non-programmers can compose or modify a UI. Exposing effects such as drag-and-drop, async update, etc., as components or attributes further eases the development of complex user interfaces for non-programmers and programmers alike.
Tools
As of this writing there is no IDE integration for ZK. This is really a crying shame, since the ZUML makes a WYSIWYG UI layout tool a natural fit.
JWAX - A Little Raw
Yet another client-side AJAX component GUI framework is JWAX. The class model resembles that of Swing somewhat and a seperate rendering layer realizes the components in the presentation medium of choice. Right now only DHTML is done, but XUL XAML and support for custom renderers are planned.
The demo is a bit raw, with most of the app not working in a recent version of Firefox and strange menu, tree, dragging and other behavior in IE 6. Since one of the main selling points of a framework is that you can implement cross browser support in a relatively compact rendering layer and client engine, this failing is unforgiveable. Let this one ripen for another 6 months and check back.
Update 1: I was incorrect in identifying this as a server-side framework (odd, since I tinkered with the client-side Javascript code a bit). I've corrected the information above. It is still is a bit raw, however. Thanks to the reader who caught the mistake.
Topics: Ajax Components, Ajax Frameworks, Ajax Tools, Frameworks, Review
Zohowriter - an Ajax based word processor
These word processors are springing up like weeds. YAAWP (Yet Another Ajax Word Processor) is Zohowriter. By only beef so far is that it has a few defects and doesn't seem to behave quite like a desktop Word Processor. In particular, the text properties in the formatting bar don't always change when selecting text in the document.
So, are all of these word processors actually useful, or is the word processor to Ajax applications what the chess program was to AI, aka "the drosophila of AI?"
Topics: Ajax Examples, Ajax Products, Office, Review
ASP.NET Ajax Reviews
Daniel Zeiss has put together the and excellent review of Ajax frameworks for ASP.NET. He narrowed down his selection of frameworks as follows
First, let me explain why only these 11 Frameworks are included although there is a lot more AJAX stuff for ASP.NET out there. All the frameworks listed here have one unique AJAX feature: They allow updating page content without programming AJAX directly - i call it indirect AJAX programming - a comparable concept is called Hijax. To make it concrete: Direct AJAX programming would mean dealing with client scripts, DHTML, method proxies, client side rendering and so on... Another important property the framework must have is the ability to support non-AJAX controls and enhance them with AJAX features. Therefore, frameworks that supply only controls with built in AJAX-features (Buttons, Trees, Grids, Lists and so on...) are not included in the comparison.
He has done extensive work in road testing and comparing. Well worth a look.
Topics: Ajax Frameworks, ASP.NET, Frameworks, Review
Ajax AIM Client
I know this is old news, but for those not scouring the web for what can be done with Ajax, check out this instant messaging client. It definitely pushes the boundaries of what can be done with rich clients. If you can do IM, the most interactive and instantaneous of all of our desktop apps, what else is possible?
Topics: Ajax Examples, Ajax Tools, Review
About Pathfinder
Recent
- Roles Testing For Security
- Blackbird takes the pain out of JavaScript logging
- Making GWT JSON not Quite so Painful
- IDEA - preconference workshop 06 Oct 08
- HTML5, Ajax history management, and The Ajax Experience 2008 Boston
- A Look Back At Past Posts
- Flash Player on iPhone gossip
- Microsoft to Jump on Board EC2
- TAE Boston 2008: The Unsexy Presentations
- The Ajax Experience 2008: Hope to see you in Beantown
Archives
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006



