Home | Site map | Contact
>>Chronoviator Official Website
www.chronoviator.com
ronald@chronoviator.com
Ronald G. Bernardo
Multimedia Specialist (ilc.upmin.edu.ph)
University of the Philippines Mindanao

Wednesday, August 6, 2008

Flash RIAs vs. Javascript RIAs


Javascript RIAs (aka AJAX) don’t come close to the interactivity that developers can implement using technologies like Flash or Java. For example, there is no easy way of integrating with audio and video content, there is no ready-made toolkit of application widgets (tree-views, data-grids, etc). There are undeniable advanatages to the JavaScript RIA approach, however. So how do you decide whether a Javascript RIA (or “AJAX”, if you must) or a Flash RIA is right for the project you’re working on?

Download Size
Clearly DHTML pages will end up being smaller (on average) than Flash SWF files or Java applets (assuming a rich approach that doesn’t repeatedly download the html). If your client may be using a slow internet connection, a JavaScript RIA will have advantages. Similarly, if you’re application is going to be deployed on a very popular site (like google!), reducing downloads will also save you a lot of money on bandwidth.

Politics and Such
XMLHttpRequest is an API that belongs to Microsoft and is not part of the JavaScript standard. Given that Microsoft is NOT interested in open web-based standards becoming more powerful, there is a risk that the next version of IE will break XMLHttpRequest in a subtle or perhaps, not-so-subtle way. They wouldn’t even be guilty of violating a real standard if they did this, just a de-facto standard. And you can bet they would love to break all that cool code that google just finished writing!

Of course, if you do Flash or Java development, you are at the mercy of Macromedia or Sun, and the changes they make to their browser plugins. So which company you trust to “do the right thing” becomes a relevant question. In general, Java and Flash JVMs have been backwards-compatible, and Microsoft has an established history of keeping standards in constant flux to cripple their competition (a tactic that Joel Spolsky aptly calls “cover fire”). Draw your own conclusions.

Staffing
It is definitely easier to hire “vanilla web developers” than people who can do real engineering using Flash. Drew McLellan writes

"It's hard to find good people who are also prepared to work with tools like Flash. I'm sure they exist, but finding someone who's a good Flash developer and is also geographically close and available for work is hard."

I’ve despaired at hiring good Flash engineers, and resorted to hiring Java Developers and retraining them. This approach works if you can keep your Java Developers involved and invested in Flash. But you just don’t face these kinds of staffing issues with JavaScript: there will always be web developers.

Integration with multimedia
One of the big advantages of Flash is that it natively supports streaming audio and video, something that obviously isn’t a part of DHTML. If you’re working with multimedia, Flash is definitely the RIA platform to build your application on.

Availability of UI toolkits
Flash and Java come with UI toolkits for such things as tree views and data grids. These components are absent in the Javascript world (although enterprising companies are moving in to fill the gaps: look for some introductions to the newer players in this space shortly on my blog). If that's important to you, that either Flash or Java are a much better option comparted to developing a JavaScript RIA.


Maintainable Code
Javascript development in general requires writing code that runs on different browsers and “degrades gracefully”. For example, there is a reasonable chance the XMLHttpRequest object won’t be present in a given browser: your code has to handle this. As jibbering writes:

“Even in IE the XMLHttpRequest object can often be blocked by slightly raised security settings (popular due to the commonly exploited holes of course)”

Writing this kind of code (in order to work on all browsers and degrade gracefully, everything is implemented two or three times) is annoying. Maintaining this kind of code is a real nightmare. When you depend on a plugin like Flash, compatibility problems are all but eliminated: as long as your client has the right plugin, your code should work.

On the other hand, writing maintainable Flash code is no picnic either. Actionscript (unlike JavaScript) is an object-oriented language, so there is the potential for extremely elegant and maintainable code. But unless you abandon the Flash IDE entirely (and good luck finding a Flash designer who can work without it) you will end up with a big binary FLA file that is hard for maintenance programmers to deconstruct and understand (see Flash Better Practices for the gory details). Here I’m going to give Flash the advantage, but it’s not a knockout blow: it's more of a judgement call.

Conclusion
I hope this article provides a beginning framework for deciding whether to implement your next RIA in JavaScript or Flash. The two technologies have very different profiles, and in many ways compliment each other, so both are likely to be quite important to web developers for the conceivable future. so there should be room for both approaches: no need to be a technology bigot! A nice debate on the topic is currently perolating in the Flash forums, and the discussion continues on Slashdot and elsewhere. As always, the space below is for feedback and discussion.

by Jonathan Boutelle

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Back Home


Commercial Flash Templates

Our team can develop:
Website Templates Blog Templates
Flash Website Templates OSC Templates
E-Classroom Website using a CMS
   
   
 
Copyrights (c) 2008 Interactive Websites Co
All rights reserved