Welcome!

AJAX & REA Authors: Charlene Qu, Yakov Fain, Andreas Grabner, Lori MacVittie, Kevin Hoffman

Related Topics: AJAX & REA

AJAX & REA: Article

Real-World AJAX Book Preview: Leading-Edge Best Practices

Real-World AJAX Book Preview: Leading-Edge Best Practices

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs for the special pre-order price, click here for more information. Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start developing AJAX applications.

Leading-Edge Best Practices
The dream is always the same. The "Big Idea" comes to me as a bolt out of the blue. I sit down at my computer, install Ruby on Rails, and in a few hours I've published a working prototype on the World Wide Web. A message to this forum, an entry on that blog, an e-mail to a few friends, and WHAM! I have users.

My users post messages to these forums, entries to those blogs, text messages to their friends, and the God of Network Effects blesses me; in weeks, there are a million users. They provide feedback; I provide features.

Every hour - 24 hours a day, 7 days a week - I push out a new version and I'm rewarded with more and happier users. In six months, I've sold out and am off to Tahiti to sip fruity umbrella drinks. Without process, quality assurance or even venture capital, I've joined the ranks of the Web 2.0 millionaires!

Then I wake up. It's time to go to work, making the world safe for consumer package goods companies. Newfangled notions such as permanent beta and semantic Webs hold no currency with our customers. In the old matrix of A, B, and C companies (early adopters, time-is-ripers, and footdragging Luddites, respectively), our customers hover somewhere between B- and C+. They're just about ready to move into the 21st century and congratulate themselves for successfully sitting out the dot.com crash.

This chapter will explore the best practices for Web 2.0 application development in a way that addresses a range of computing environments, from the start-up with dreams of glory to the hidebound dinosaurs that populate the rich fields of enterprise computing.

Web 2.0 and AJAX
The term "Web 2.0" was coined by O'Reilly Media to describe the next generation of Internet applications that were beginning to appear. At first, it was defined more by examples (Wikipedia, Flickr, Digg) than by actual qualities; but the major aspect that distinguishes a Web 2.0 application from a (retrospectively labeled) Web 1.0 application is collaboration and information sharing.

Web 1.0 applications provided content - brochureware, search engines, travel planning - and users consumed it. In Web 2.0, the applications provide only the infrastructure; users both produce and consume content.

In Google's Web 2.0 e-mail system, Gmail, sophisticated JavaScript clients provide WYSIWIG e-mail editing while Asynchronous JavaScript and XML (AJAX) allow periodic polling of the server and automatic updates of the user's inbox.

AJAX acts as a lynchpin in the Web 2.0 architecture, providing a mechanism for communicating with back-end services without requiring that the entire page be reloaded. This in turn enabled the creation of rich Internet applications (RIAs). Google and others are working on desktop suites: spreadsheets, word processors, and calendars with the functional reach of Microsoft Office delivered through the zero footprint convenience of a browser.

Over the past two years, a set of best practices has emerged for Web 2.0 application development. There's still obviously a fair amount of debate about these, but the basic tenets are:

  • Leveraging Users as Testers: Traditional software release cycles kept the application out of the hands of all but a few users until it was officially released. The Web 2.0 paradigm is to release early and release often, allowing users to collaborate in the actual development of the application.
  • Real-Time Monitoring and Sampling: Web 2.0 applications can track how the user actually uses the application and report this information back to the service provider. This automates feedback and lets developers shape the user experience accordingly.
  • Shadow Applications: Web 2.0 developers write two types of applications: the public application published to the users and one or more private applications, which helps the developer understand how the user is using, or not using, the public application.
  • Permanent Revolution: A consequence of "release early, release often" is that applications are identified by a timestamp - the date and time the release was published - rather than by version number. Since the application is effectively installed in the browser every time the user runs it, he is by definition using the latest version. There is no longer a need to worry about supporting old versions.
  • Public APIs: Web applications provide public server-side APIs providing third-party access to their services; the client side of these applications are built on top of these APIs.
  • Graceful Degradation: The best Web 2.0 applications provide some feedback to users if their browsers don't support the technical requirements for running them.
Let's examine each of these best practices in turn.

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs, click here to order.

More Stories By Greg Winton

Greg Winton is a 20 year veteran of software development specializing in network and mobile application development. Currently Greg is leading the Web 2.0 initiative at Vision Chain, Inc., a Washington DC based software company specializing in demand signal repositories and interconnected enterprise applications. Author of "Palm OS Network Programming" (O'Reilly, 2001) and several articles on handheld development and usability, Greg has been making the world a better place for end users one enlightened developer at a time.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.