2006/05/12

My very first AJAX application

Finally I lost my virginity in AJAX :) The application I chose as guinea pig is very simple: a financial calculator that I have been rewriting in several languages since 1993 (Clipper, Access, Visual Basic, Excel, Delphi, Java, and Javascript). The version shown in the picture is TurboGears/AJAX.

Of course this specific application fits better as pure Java or Javascript, without remote calculation. The point was to send a XML HTTP request, and receive the answer asynchronously. The "Wait..." message, plus an artificial pause of 1 second at the server side, makes clear that calculation is remote.

Turbogears is proving to be more and more convenient. It was very easy to export the calculation methods in JSON interface, and very easy to call them from Javascript side using Mochikit helper functions.

Of course that asynchronous programming, plus having to deal with two dissimilar languages, makes development inherently more difficult. But you can't avoid that if you are developing for the Web, and TurboGears really helps in this way.

If you are interested in play with this calculator, download the Turbogears project from this tar file or, better yet, the Egg file. Note that this project is for Turbogears 0.9.

Python Eggs are a new format proposed for Python packages, that Turbogears makes use to install itself. When you create a new Turbogears application, egg configurations are put in place, and packaging is just one command away.

1 Comentários:

Às 12:10 , Anonymous Anônimo disse...

Hello (e olá!)

nice job!

Since TG is so powerfull its easy to get lost. Your tutorial is clean and easy to follow, thought me a lot! Thanks!

Vinicius

vinibaggio AT NOSPAMMM! gmail.com

 

Postar um comentário

<< Início