Fun With Flex

January 22, 2009 - zenoconsultingzenoconsulting


So, I started playing around with Adobe Flex mainly because I like the fact that it offers cross platform support, and it seems pretty easy, and it has nice UI widgets. I've used other frameworks that have nice UI widgets, but none of them have been cross-platform. Java GUIs are maybe getting easier to build with the Netbeans framework and Matisse, but I think it is still a big investment.

Incidentally, I happen to know someone who is a total wizard at Java UI and loves to build them. If you're looking for someone like that let me know.

Anyway, Flex is nice because as Bruce Eckel says: the web is a mess. I have stayed away from doing a lot of heavy web programming over the years. I never liked it. I agree whole-heartedly with Eckel's analysis. The whole thing seems like a giant hack.

Flex is easy…and that makes one more productive. I built a simple demo in a couple hours that looks up a book by ISBN number on Amazon and displays the results. Ok, it is not very pretty, but it was fun and easy to do and was quick considering I have never used Flex / MXML or ActionScript at all.

The SWF is broken since Amazon changed their API to require HMAC signing with timestamps.

I was curious about this because I have been working on a decent content management system for PDF and CHM files. I have a large collection of technical books in electronic format. Managing them is a pain. I built software in Java that will parse the contents of PDF or CHM files and dig out the ISBN numbers. It has to be slightly more intelligent than just returning every ISBN it finds. Sometimes there are multiple ISBN numbers. Sometimes the number contains invalid characters, etc. I built some algorithms that do a best match, and after some testing on a large directory full of files, it got a match ~80% of the time.

Once I have the ISBN number, I get the book contents from Amazon. I stuff this into a database with a simple JPA entity model using Hibernate. I just plugged in HSQL-DB because I wanted something light and simple.

Anyway, all of that is kind of working — but the next step would be to build a UI for it. That's kind of why I got interested in Flex. One thing that intrigued me was this video demo of the Flex Lifecycle Data Services by James Ward. It is a long video, but if you have the time, it is worth watching.

So, I got to thinking about building the application for AIR. I could embed a small Jetty container inside the app that does all the Java stuff, and build the UI with Flex/Air. It would be cool to just drag-n-drop a file onto the app — have it dig out the ISBN and lookup the info, and persist a record it locally.

Several different views could be provided: datagrid — just for manual tweaking / maintenance. Lucene-driven content search. Keyword/Subject search. Nifty accordion cover-slide view. Click on the cover and the book launches.

It is a weekend project. I'll finish it eventually. After I finish learning Haskell :)


Backlinks


Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License