RIA’s, Rails and you.

20 03 2007

Imagine for a second that you’ve had this really great idea for a new web based application
and you built it using standard HTML and some form of server side scripting.
You’re pretty pleased with it, but a short while later a similar app pops up out of nowhere with a better interface.
At that point, you start dabbling with the dark magick or RIA’s, only to get stuck.

RIA?
Rich Application Interface.
Basically, a way of making a web application function more like a desktop application by eliminating page refreshing for most common actions performed within the application.

Common methods for RIA’s
A RIA application can be built with a number of technologies.
The two most notable right now are AJAX (a mixture of JavaScript, browser technologies and server side scripting) and Adobe Flex (a system that compiles a mix of XML, ActionScript and CSS into a usable Flash 9 file.
There’s also the older OpenLazslo, which is now coming up to version 4, which does some similar stuff to Flex, but which will also create a DHTML based version of it’s output if needed.

AJAX:
AJAX is ready and raring to go in Rails thanks to it’s integration with the Prototype and Scriptaculous libraries.
The basic AJAX stuff is easy to use in Rails apps and the generated code is also pretty readable, even for someone like me who never bothered much with JavaScript when learning to code.
One slight issue is that it can sometimes feel like you’re locked in unless you want to learn to use those AJAX libraries directly as there’s only so much Rails will do for you, but what it does do is often enough unless you’re doing something more complex (I’ve had no real problems using AJAX in the CMS I’ve been tinkering with as a first project with Rails).

The advantage of using AJAX via the Rails helpers is that you don’t have to type masses of code to make an animated drop down that displays data from a discreetly executed script and it’s quite possible to code around issues with users who don’t have browsers with support for xmlhttprequest, or who have JavaScript disabled.

The problems with AJAX other than the one mentioned earlier are that if you’re using AJAX, code validation can be a little more tricky as you can have display data in different places and something like W3C’s HTML validator won’t pick up on code inserted via JavaScript.
Another disadvantage is that whenever some new code is inserted, you may end up waiting in order for everything to update.

Flex:
Flex 2 is Adobe’s RIA generator platform as well as a tool for writing some Flash applications.
It basically allows you to write code in an XML based syntax with ActionScript mixed in for logic and CSS for presentation.

The benefit of Flex is that it saves you writing XHTML code for your interface and having to test that code in every browser platform to make sure it looks good as Flash apps will look the same regardless of if the user has Explorer 6 or Firefox 2.
On top of that, there’s still Flash’s ability to do what it does best, pretty and detailed animations that can update and change on the fly.
Taking a look at the Flex style editor application on Adobe’s site shows this off quite well as styling changes are done as you move sliders and change values, including the curvature of the element corners.

One big issue with Flex is that it’s reliant on Flash 9.
While Flash 9 is out now for Windows, OSX and Linux, people who don’t like Flash (you’d be surprised how many find it annoying) or don’t have access to Flash 9 will be stuck unless you cater to them by providing another interface.

Flex, being Flash powered, is designed to consume data in an XML format, but Rails provides a set of tools for easily generating XML data and there’s alreaty integration tools to make Rails + Flex applications easier to build.

As well as Flex, Adobe has been working on a system called Apollo, which is basically Flex for the desktop.
Apollo uses a runtime though, so it shouldn’t have any real issues with people not having the right version of the Flash stand alone player.

The only real gripe I can pick with Flex right now is the lack of a decent editor for it that doesn’t cost over £300 and which will run on my choice of OS (Flex Builder 2 is built on top of Eclipse and offers visual interface design tools like you’d get in Delphi or Visual Studio, but unlike Eclipse, it’s only out for Windows and OSX).
The whole “charting costs extra” thing doesn’t really bother me as Rails has it’s own charting packages that output to image files, which are then capable of being imported into Flex applications.

For more on Flex, pop by http://flexfanatic.wordpress.com/

Open Lazslo:
Open Lazslo is an older contender which was once commercial, but which is now free.
It does the same sort of things as Flex, in a similar way, but while Flex uses syntax like <mx: tag/>, Lazslo just uses <tag/> and Laszlo doesn’t use ActionScript, it uses JavaScript.

OL has many of the same issues as Flex when it comes to building interfaces with Flash, though it’s version requirements aren’t as high at Flash 7.
I’m not sure if there is a proper Lazslo editor out there as I’ve only used it through the example interface on their site.
I had some issues with OL and how it handles scrolling on things such as multi-line text boxes, but other than that, there was nothing major.

One advantage of Lazslo when it gets a version 4 final release will be that it can output to DHTML as well as Flash 7.
While DHTML may be the devil child that ruined many sites and “DOM scripting” and “AJAX” sound better, at least you’ve got options with OL as to what your code comes out as.

Again, OL consumes XML, but again, Rails is pretty good at spitting out XML code.

Other options:
Well, there’s always plain Flash, plain reloading interfaces or you could try to find something else to suit your needs such as Java… It depends on what you need and what you want as well as on what you expect your end users to have installed on their systems.

Advertisements

Actions

Information

2 responses

24 03 2007
danielneri

Hey Nuvo

thanks for the little link there 😛

I’ll be sure to link to you in my posts!

Nice blog by the way, good luck with it!

28 03 2007
Ravi Kumar

How about FusionCharts Free for charting – http://www.fusioncharts.com/free – completely free without any limitations as such.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: