blog community
Folder Visualizer: A JavaFX and Adobe AIR comparison

Introduction

The last few weeks, Jamie Craane and I have been working on a small but usefull tool called Folder Visualizer. The idea of this tool is that it can scan your harddrive and make a visual representation of where the largest directories are located on the harddisk. This is most useful when cleaning up space. The project is available at Google Code: http://code.google.com/p/folder-visualizer/

Under featured downloads you'll find a .air and a .jnlp file to start both versions directly. 

 Besides the usefulness of the tool itself, the main important thing of this project was to compare JavaFX and Adobe AIR. We both like both platforms, but we wanted to have a case study that shows the cons and pros of each. Jamie created the Adobe AIR variant while I did the JavaFX one.

Step one was to create the algoritm of the directory scanner. We initially did this in Groovy. This post is not really about Groovy, but once again we found Groovy to be much easier than plain Java for the task at hand. Jamie had to re-implement the algoritm in ActionScript later, because AIR can't call Java libraries. More about that later.

JavaFX

Implementing the app with JavaFX was really easy. There is a quite steep learningcurve however if you're just used to Java. JavaFX is nothing like Java. This is a good thing because JavaFX can be seen as a DSL for UIs while Java is a general purpose language. It also means a big challange when you just get started with the language. The disadvantage of JavaFX is that there are not that much components available yet, and that components doesn't look really cool by default. This means you have to do everything yourself, and even a simple application like the Folder Visualizer requires custom drawing. The other side of the story is that this gives you limitless possiblities to style your application just as you want, because you're not limited to out-of-the-box components. 

 The most important reason to choose JavaFX over AIR might be the fact that JavaFX runs on the Java platform. Note that I'm talking about the Java platform and not necessarily about the Java language. This means we can leverage all libraries and existing code that we have on the Java platform.

But didn't Flex/AIR integrate with Java also? You might have seen examples of Flex applications using a Java backend. This is just remoting over HTTP however, and not really direct platform integration. This is not a problem for online applications (Flex), but it is for offline desktop applications. You don't want to do remoting locally just to be able to call Java libraries... 

AIR

The strongest point of AIR/Flex is probably the large amount of high quality components available. This means you're application looks good, even if you didn't do any custom skinning. The same is true of basic animations/transitions, it's just something you declare on a component. Because of this, it's (at least at this point) easier to create an application in AIR than creating the same application with JavaFX. There is a point however where you do need custom drawing. For example, to create new components. This is a lot harder than JavaFX. 

As soon as there are more components available for JavaFX, the advantage might go to the side of JavaFX because it than has both the possibility to draw stuff yourself, and use out-of-the-box components. We still have to wait and see how this develops however.

The same is true for tooling at this moment. Flex/AIR IDE support is ok (while not great to my opinion) but the JavaFX tooling isn't really much yet. Both IDE support and a designer tool can be expected shortly after the JavaFX release. 

The biggest con of AIR is the lack of Java platform support as said before. This is specially true because the ActionScript language really misses out on important features such as threading, and the language itself also can't keep up with a language such as Groovy. A bigger issue is the fact that you can't use Java libraries of course, and people have to re-invent the wheel for ActionScript. Take a look at ActionScript dependency injection frameworks for example.

Conclusion

JavaFX is just not finished yet, so if you have to choose a technology right now, go for Flex/AIR. Looking ahead in time however, there are some really big advantages of JavaFX over AIR. It will completetly depend on the availability of tooling and components for JavaFX to decide which technology is the better choise in the future.


Posted 27-06-2008 9:14 by Paulb
Filed under: , , , ,

Comments

Richard Monson-Haefel wrote re: Folder Visualizer: A JavaFX and Adobe AIR comparison
on 01-07-2008 18:10
I'm not sure if Curl is an appropriate platform for creating a hard-drive visualization as Curl enforces a pretty stick sandbox - if gives you lots of disk space but quarantines it from the rest of your drive. This is one of the reasons that Curl is great for the enterprise but may not be the best choice for mass-consumer applications.
,br> Anyway, I thought you should consider Curl as its pretty easy to program in, is faster than Flex/AIR (not sure about Java), and has a large library of components.

All the best,

Richard Monson-Haefel VP of Developer Relations Curl, Inc. http://www.curl.com
Paulb wrote re: Folder Visualizer: A JavaFX and Adobe AIR comparison
on 02-07-2008 8:15

Hi Richard,

I had a quick look at Curl, and it sure looks interesting. Not sure if it would be possible to create a application like the Folder Visualizer because of the sandbox model. This model is perfect for in-browser RIA applications, but not really for 'normal' desktop applications.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Enter code (required)
Powered by Community Server (Commercial Edition), by Telligent Systems