Friday, March 27th, 2009
We recently posted on Atmosphere, a new framework designed to provide an abstraction layer over Comet back-ends for Java web applications. At a personal level, this comes at an interesting time as over in the Mozilla Labs we’re evaluating different Comet approaches for our upcoming collaboration release. As we looked at various options, we come across some recent postings from Ted Goddard of IceFaces fame explaining their work on making Comet as simple as possible for Java developers, including a podcast and an overview of the IceFaces approach.
Say what you will about JSF, their abstraction layer makes server and client implementation of Comet incredibly simple:
In other words, we can re-use our existing Ajax pipeline, and the application developer only needs to worry about one thing: requesting that a page be rendered. As you can imagine, this is only a few lines of code. With ICEfaces it looks like this:java
- // somewhere else in the presentation tier
Not only does the application developer not have to worry about low-level protocol details or messaging, they don’t even have to worry about what has changed on the page — this is all taken care of by the declared binding between the page and the model.
To summarize: we have dynamic pages that can be rendered on the server at any time, and the updates are pushed to the browser where the changes are applied to the DOM. From the application developer’s point of view, that’s all there is to it.
Are you using a stack that makes Comet this easy? Have you been able to successfully implement Comet? Do you get sufficient performance from polling?
Posted by Ben Galbraith at 7:00 am