Wednesday, November 2nd, 2005

Single-page vs. Multi-page Ajax Applications

Category: Editorial

Joe Walker has written up his thoughts on Single-page vs. Multi-page design of Ajax applications.

He discusses why he thinks that:

  • Multi-page is easier
  • Multi-page can give a faster initial download
  • Single-page gives you advanced history
  • Single-page offers faster rendering
  • Single-page makes it easier to share components

Recommendations

It’s probably fairly obvious from this that there is no one correct answer. The best route for you will depend on what you are trying to do.

I’ve painted it a bit of an all or nothing so far – one page or many. In reality there is often a reduced-page option that keeps the advantages of automatic history and bookmarking, but adds some of the advantages of a single page design.

Depending on how you code, it might be possible to change make changes in direction during development, so it is a good idea to make sure your HTML ids are unique across your entire web application. I have taken to giving each section of my web apps a name to prefix HTML ids to help keeping things unique.

I’ve recently taken a 74 page JSP application and turned it into a single page DWR application. This has been a very interesting process. The result is surprisingly small – 450 lines of HTML and 200 of CSS – this isn’t the behemoth that you might expect.

If I were to start again I would probably consider 3 or 4 page design more carefully. This would create a simple solution to the back button and book-marking issues without needing support from RSH or Dojo.

In summary – there is no “correct” answer, but more of an it-depends. Single-page is harder, but can give better results.

Most of the Ajax designs coming out of Google (GMail, Reader, Maps), Yahoo (Oddpost), and Microsoft (Kahuna, Start) are single page. Others are reduced page (Writely.com for example), which suggests that they are putting the effort into a more user-friendly design.

Posted by Dion Almaer at 8:46 am
3 Comments

+++--
3.8 rating from 21 votes

3 Comments »

Comments feed

[…] Map out the route your packages take on their way to their destination with Package Mapper. Its built on Ruby on Rails, and you can see use of scriptaculous effects in many spots. It looks pretty close to the single page model Joe described a while ago. […]

Pingback by Ajaxian » Package Mapper - track your shipments on google maps — January 12, 2006

[…] Map out the route your packages take on their way to their destination with Package Mapper. Its built on Ruby on Rails, and you can see use of scriptaculous effects in many spots. It looks pretty close to the single page model Joe described a while ago.   […]

Pingback by Adrian’s Blog » Package Mapper - track your shipments on google maps — January 12, 2006

[…] Map out the route your packages take on their way to their destination with Package Mapper. Its built on Ruby on Rails, and you can see use of scriptaculous effects in many spots. It looks pretty close to the single page model Joe described a while ago. […]

Pingback by xajA [zaya] : Ajax [eidjeks] » Blog Archive » Package Mapper - track your shipments on google maps — January 13, 2006

Leave a comment

You must be logged in to post a comment.