TechRepublic : A ZDNet Tech Community

Programming and Development

Host: Justin James
Contact

An interesting and unfortunate by-product of AJAX applications is that these applications rely upon the existence of an application server always being available. Many Web users are used to the idea that they can save a Web page to be read at their convenience. Even when there is Flash on the page, the page still works offline. After all, HTML is simply a document storage format, and HTTP is simply a protocol designed to optimally transmit HTML documents. But, in reality, more and more Web developers are assuming that the user will not want to save the Web page or lose network connectivity. I think that this is a mistake.

A lot of frameworks have come out recently that are designed to tackle the offline problem; the frameworks’ approach is usually to run a database on the client. The database can cache data from the “home server,” and if the user makes changes while offline, that database can write the changes back to the “home server” when it becomes available again. These frameworks don’t do anything about all of the back and forth requests to the app server that AJAX applications generate.

Some developers try to tackle this problem by loading a miniature application server on the client via Java (or similar “applet” style technologies). This approach works. However, after a certain point, I wonder how many hoops someone needs to jump through to compensate for an inherent shortcoming of a particular technique before it becomes clear that a technique might not meet their needs.

Even assuming that you can put a miniature application server and database server on the client that can cache and sync with the master servers whenever possible, you still have not solved the problem of “saving a Web page.” The user doesn’t think they are using an “application”; if it runs in a Web browser, they treat it like a Web page. Users are always clicking the Back button (which messes up AJAX apps) because they expect it to work like the Undo button. And incidentally, it does work like the Undo button in a more traditional step-by-step forms-based application. Ironically, one of the biggest issues that AJAX addresses in traditional Web development is the stateless nature of the HTTP protocol — and yet it suffers from its own lack of state.

Let’s take a “product finder” application as an example. In the application, the user selects various options as “must have” and “nice to have” features. Some of these are Boolean selections, while others might be numeric ranges, and one or two might be “one-of-many” or “many-of-many” options. Now, let’s imagine that our user has narrowed her choices down to four products from the original 50. She decided to save the Web page to disk so she can e-mail it to her boss or coworkers for review. Whoops! Her boss and coworkers will likely have a problem if they try to bookmark the page or e-mail the link. In a traditional Web application, if the developer is smart, he or she will use GET rather than POST for these scenarios to ensure that the link accurately represents the application’s state, and the page is quite easily saved in its current state.

I am not saying that AJAX applications cannot function like this; however, until users get used to the idea that the traditional model no longer applies, developers will want to find smart and creative ways of addressing this issue. One way of doing this would be to periodically “tag” the state with a hash code and redirect the browser to a URL that calls that hash code (for example, http://www.site.com/application/j7qw132j). This way, if the user hits the Back button, she goes back, say, two minutes in time (or 10 operations) rather than back to the beginning. Also, the user can e-mail (or bookmark) that link. Developers often build in E-mail This Page, Bookmark This Page, or even Save This Page buttons on their site, but it takes effort to build in the buttons, and users often miss those buttons or assume that they do the same thing as the similarly labeled browser functions.

I think that developers who work hard can find some creative, workable, and usable solutions for this issue, and their users will appreciate it.

J.Ja

Disclosure of Justin’s industry affiliations: Justin James has a working arrangement with Microsoft to write an article for MSDN Magazine.

Additional resources about AJAX on TechRepublic

Justin JamesJustin James is an employee of Levit & James, Inc. in a multidisciplinary role that combines programming, network management, and systems administration. He has been blogging at TechRepublic since 2005. Read his full bio and profile.

Print/View all Posts Comments on this blog

Are your Web pages useful without HTTP? Justin James | 05/30/08
I have to take exception Hendry_Betts | 06/03/08
Actually... Justin James | 06/03/08
X windows sessions over RPC/SSH? really?? miguel.tronix@... | 06/04/08
A bit of background Justin James | 06/06/08
true it has been tried miguel.tronix@... | 06/08/08
Digital Divide? dashifen@... | 05/30/08
Digital divide, yes Justin James | 05/30/08
Familiarity and Age mattohare@... | 06/03/08
Age, indeed Justin James | 06/03/08
Yes, Let's Add More Compexity To The Web! blackfalconsoftware@... | 06/03/08
Useability is not fluff! dallascaley@... | 06/03/08
How much usability does one need? blackfalconsoftware@... | 06/03/08
Oh My Yes! Let's Go Back shall we? Hendry_Betts | 06/03/08
For simple it's not a problem, Tony Hopkinson | 06/04/08
Exactly Elvis.Is.Alive | 06/05/08
No, we shouldn't just sit back alaniane@... | 06/06/08
I would adopt a new protocol Elvis.Is.Alive | 06/07/08
New protocol? Justin James | 06/07/08
SQL in web pages. Ah not that again ! Tony Hopkinson | 06/08/08
1.1.3 Relationship to XUL, Flash, Silverlight, and other proprietary miguel.tronix@... | 06/08/08
It's called separation of concerns Tony Hopkinson | 06/09/08
Seperation of concerns, I entirely agree miguel.tronix@... | 06/09/08
I agree and disagree Justin James | 06/03/08
Shoehorning? Or Maximizing Adoption? Elvis.Is.Alive | 06/05/08
Maybe Http was ? Tony Hopkinson | 06/05/08
Standardized "platform", not necessarily "interface" Elvis.Is.Alive | 06/06/08
I'm not sure that another technology will come along Tony Hopkinson | 06/07/08
I agree with this Justin James | 06/07/08
Viva Vi-AJAX! Justin James | 06/06/08
I think I'm finally seeing the light... Elvis.Is.Alive | 06/09/08
Yes, Let's Add More Compexity To The Web!... Redux blackfalconsoftware@... | 06/07/08
RE: AJAX should not mandate HTTP LyleTaylor | 05/30/08
Page vs. apps Justin James | 05/30/08
Therein lies the rub Tony Hopkinson | 05/30/08
depends on the app aardvark92 | 05/30/08
Well yes, but all the problems with web apps Tony Hopkinson | 05/31/08
That's exactly my thoughts Justin James | 05/30/08
It's under the big W seanferd | 06/03/08
The big W, woud be better all round I feel Tony Hopkinson | 06/03/08
I would tend to agree seanferd | 06/05/08
I feel like you have two articles here! mattohare@... | 06/03/08
It almost was two articles Justin James | 06/03/08
RE: AJAX should not mandate HTTP Elvis.Is.Alive | 06/03/08
Exactly Justin James | 06/03/08
User Expectations Do Not Change Just Because We Want It michael.crocker@... | 06/03/08
Programmers should not force users to give up useful functionality kj_easy | 06/04/08
Yep Tony Hopkinson | 06/04/08
When I was a young alaniane@... | 06/06/08
It's just convenient for the designers, not the users Tony Hopkinson | 06/07/08
I hear ya miguel.tronix@... | 06/04/08
Poor analogy.The horizontal tray is a Tony Hopkinson | 06/05/08

What do you think?

White Papers, Webcasts, and Downloads

Recent Entries

TR on Twitter

Archives

TechRepublic Blogs



Quick Reference: Linux Commands
Reduce stress and speed up resolutions with the easiest command references right at your fingertips. You'll receive a PDF file covering Linux, packed with the most common commands you'll need and use daily.
Buy Now
500 Things Every Technology Professional Needs to Know
Did you know Microsoft's RegClean does not work with XP but you can use shareware to clean your registry? Did you know most wireless access points don't have encryption enabled by default? Did you know there are 500 tidbits of information contained in TechRepublic's 500 Things Every Technology Professional Needs to Know that will help you become a successful IT professional.
Buy Now

Popular Sanity Saver Videos