Filed under: Flex

Reuse your Flex SDK with Sprouts

Well, I just started taking a look at Sprouts to manage my Flex builds by I didn't want to download the Flex SDK again! As soon as I saw that Sprouts was trying to download the flex_sdk_3.zip file I just Ctrl-C and did the following:
  1. touch ~/.sprouts/cache/sprout-flex3sdk-tool-3.3.0/flex_sdk_3.zip
  2. ln -s /opt/Adobe Flex/flex_sdk_3 ~/.sprouts/cache/sprout-flex3sdk-tool-3.3.0/archive
This just fools Sprouts which is advised against in the google groups discussions but saves my some time :P I did a similar process for the Flash Player 10 which I had downloaded but you could also use the one that came with the Flex SDK. Basically you need to :
  1. touch  ~/.sprouts/cache/0.7/sprout-flashplayer-tool-10.22.1/flash_player_10_linux_dev.tar.gz
  2. mkdir ~/.sprouts/cache/0.7/sprout-flashplayer-tool-10.22.1/archive
  3. ln -s <wherever>/flash_player_10_linux_dev ~/.sprouts/cache/0.7/sprout-flashplayer-tool-10.22.1/archive/flash_player_10_linux_dev
This is a simple hack but might be useful to some of you.

RIA Wars

The growing bandwith has allowed developers to provide rich Web based user interfaces and thus bring together Web and Dektop applications. You have Javascript with several new libraries sprouting almost everyday, this allows us to bring live to otherwise static HTML pages through manipulation of the DOM and using AJAX calls to get data from the server. Nonetheless javascript depends on the browser's implementation and your source code is there for anyone to see. AJAX calls are pretty cool but XML is a major overhead with large messages and slow parsing. Adobe has a huge browser penetration, close to 98% if i'm not mistaken. Most people dislike Flash and think it is only used by designers to create sexy and annoying banners. The truth is that Flash uses Mozilla's Tamarin VM for running ActionScript. Both Javascript and ActionScript are ECMAScript but with ActionScript you have the advantage that it get's compiled and your source code is not there for anyone to see (unless they disassemble it). Besides, to reproduce most of the functionality you get with Flash you need a lot of javascript libraries, especially if we're using Flex. Flex provides us a growing number of prebuild components and the UI is specified using MXML with offers a clear separation of controller and view. What's more upcoming versions of Flash will enable browsers to cache commonly used flash modules (like the Flex framework) so, you only download the library the first time you visit a site using Flex. The AMF protocol, used by Flash is now Open and there is a reference implementation freely available. This binary protocol is a lot faster than using XML or JSON and it supports pushing information thus we don't need to have clients constantly pooling our server. There are some more contenders in this RIA war, JavaFX and Silverlight. JavaFX suffers, for now, from the same problems every JAVA applet has. It does not fit well in a page, it takes too long to load and there are still many people without JAVA. When JAVA offers an easier instalation and preloads in the OS's memory then we could have a serious alternative but for now.. well it is just not up to the challenge. Silverlight has some cool ideas, it allows us to program in a myriad of languages since they share a common runtime, has hardware acceleration and, since it is from Microsoft will come preinstalled in Windows machines. Still, there is no real showcase (Microsoft is using it to build a part of their site now in beta), there have been a couple of releases which were incompatible with each other (you had to keep reinstalling the darn thing), and to get a development environment up and ready it took ages just to figure out the right one! I really like the idea of having Desktop like applications on the Web but i'd also like to have them in my desktop. Most of these allows developing both for the Web and for the Desktop but Flash and Java might just have an edge on this one. Adobe AIR allows you to develop some pretty cool desktop apps and JAVA has been improving Swing with LaF. To sum up, I like the fact that Javascript has been evolving at a fast pace but I still feel stranded by browser dependencies, I don't like to have the source code exposed and I just think that Adobe's offer is a better deal. ActionScript is a pretty decent language and the Flex framework offers us a lot of cool components. Add to that the AMF protocol with the Open Source Data Services and you have a very good solution for RIA development. What's more you have a couple of 3D libraries,Thermo's coming up ( pixel shaders ;) ) and we'll get hardware acceleration!