Thursday, January 17, 2008

Server Side JavaScript with Appjet

Most web developers are familiar with JavaScript on the browser (client side). However, JavaScript can also be used as a platform for your server side development.

While researching the possibility/feasibility of using JS on the sever side, I came across a company called AppJet. They currently offer you the ability to develop a Server Side JavaScript application through their Web Based Editor.

The fun part is that you don't have to install anything on your end. Just start writing some JavaScript code an publish your application and its hosted on their servers ready for viewing.

Now if you're only familiar with working with JavaScript on the client side, you'll have to "bend your mind" a little. This implementation of JavaScript on the server is not an Event based model. It is a simple processing of the request data, and creating a response.

Building a simple application with AppJet

I spent a some time reading the Appject Documentation, and wrote a simple little application. The application is comprised of a single text field that takes a keyword. This keyword is then appended to the url of an RSS feed (Google News) and the URL resource is retrieved from the remote server. We then just display the retrieved RSS feed.

I called the web application GNewsSearch. You can view the Source Code here.

Evaluation of the AppJet Platform

The main problem with the AppJet platform is that you cannot deploy it on your own server.. yet. The application is remotely hosted on their server.

Ease of Development

The server environment is much simpler than the browser environment since you are developing for a single platform (not multiple browsers). JavaScript libraries developed for browser deployment, can be used on AppJet, provided you do not reference browser specific Object, methods or properties.

Persistent Storage

Every web development platform needs some form of persistent storage. Appject has the global object storage for this. This allows the storage of two types of Objects: StorableObject and StorableCollection. StorableObject is used for storing singular values and StorableCollection for a dictionary (associative array) values.

Persistent Storage Retrieval

Though not as robust as a relational database, data stored in StorableCollection can be filtered and sorted.

Session Management

There is no session management built into Appject (as far as I looked into their docs). However, this can be easily built using their response.setCookie() method and their Persistent Storage mechanism.

Overall Appjet is a quick and exciting way to develop small scale web based applications.

1 comment:

Jackline said...
This comment has been removed by a blog administrator.