There are these moments in your life when you are in awe of what technology allows us to do. I remember a couple of years ago that a user on a forum was asking how to do some server side stuff in his web browser but without reloading the browser. We “experts” were all rolling our eyes and thinking, gosh yet another newbie that does not understand how web development works. You can imagine when the whole XMLHttpRequest and Ajax stuff became mainstream that we had to rethink the way we were designing our web applications.
In my current project, we have to write complex validation code for validating complex form input. The very annoying thing is that we have to write the server-side Java validation code, but replicate identically the same validation code with client-side JavaScript. This results that sometimes there is a small difference between the server- and client-side validation.. As you can imagine, leading to frustrating debugging sessions. I remember that I said to my colleague “It would be so cool if we had for instance the same JavaScript validation code that we could reuse on both client- and server side. True, we could send our client-side validation to the server with Ajax, but that would require some server roundtrips and alas, most banks are not really eager to use Ajax. So I sadly continued wondering why there are so many issues with getting the same buggy Double check in JavaScript and Java 1.4…
Yesterday, I bought a new Apple computer and I was happily installing and configuring my Eclipse environment and of course the must-have for every web-developer: Aptana! One of the big problems with JavaScript and Ajax programming is that there are barely good development environments. Syntax highlighting can be handled by most IDEs, but when it comes to complex code completion and assistance, nothing can beat Aptana as far as I know. You can either install it standalone or as an Eclipse plugin. So I surfed to the website of Aptana to get my plugin, but suddenly I stumbled on Aptana Jaxer. What caught my I was the following sentence: “Jaxer, The world’s first Ajax server”. My heart stopped beating, my whole (young) life passed by and I was thinking: “gosh, I thought I’ve seen it all…”
Here a short feature list from the website that says it all:

  • Write entire applications or presentation layers in Ajax
  • Full DOM and JavaScript on the server
  • Seamless communications between browser and server
  • Access existing pages written in other languages like PHP, Java, or Ruby on Rails
  • Share validation code on the browser and server (my favorite!)
  • Database, file, and socket access from JavaScript
  • Open-source, standards-based, and uses the APIs you already know

Basically, Aptana made it possible that the typical client-side concepts like DOM and JavaScript functions become first-class citizens on the server side. You can easily write a function that can be shared by both client- and server-side and on the server you can manipulate the client-side DOM elements. So basically, you share some kind of common namespace between the server and client. Watch this screen cast for getting an idea.
So where can this take us? I don’t think that this will conquer large financial institutions or other companies with large web applications running on Java. Most of them are still struggling with taking a stand towards plain Ajax. However, I do see a big market at first for these little applications that run on platforms like Facebook or OpenSocial, widgets, mashups, etc. I don’t know the product well enough to judge how everything is arranged with security and scalability. I can imagine that it could give developers some more head aches related to security and hacking, since it became easier to pass malicious data to the server.
It would be interesting if Aptama would rebuild the (in)famous Pet Shop Store with this technology or if they can announce a major website that adopts this technology… Aptana, take the challenge!