 | Level: Intermediate Michael Galpin (mike.sr@gmail.com), Software architect, eBay
24 Mar 2009 Web applications have gotten more and more advanced, and users are always
expecting more out of them. One of the most advanced features is Comet, also
known as reverse Asynchronous JavaScript and XML (Ajax) or server-side push. Comet allows for browser-based instant
messaging, real-time stock quotes, and so on. Advanced Ajax libraries, such as
jQuery, make
it easy to write Comet applications on the client side, but getting them to scale
on the server is still a challenge. That is where the Scala programming language
and the Lift Web application framework can step in and deliver a scalable
back end for your Comet application. In this tutorial, build a
real-time Web auction using these technologies.
Before you start
This tutorial is for developers interested in writing Comet-style Web
applications. A basic knowledge of Web applications and Ajax interactions
is useful. Lift is written in the Scala programming language, which runs on
top of the Java™ Virtual Machine. Prior knowledge of Scala is not necessary,
but experience with Java is certainly useful. You will see some
sophisticated Scala in this article, so familiarity with a functional
programming language like Haskell, OCaml, or Lisp helps as well. You will
also use the jQuery JavaScript library. None of the JavaScript is that
advanced, so familiarity with basic JavaScript is sufficient.
About this tutorial
Alex Russell first coined the term Comet in a blog entry back in 2006. He
defined Comet as event-driven, where the server has an open line of
communication to push data to the client (see Resources to read the blog entry).
In this tutorial, you will develop a Comet-style Web application called
Auction Net using Scala, Lift, and jQuery. You start by going over
the design of the application that you will be building in this tutorial.
After you know what you want to build, you will break it down into various
parts and learn how you can leverage the features of Lift to implement these
features.
Prerequisites
To develop with Lift and run the sample code, you will need the
following tools:
|  |