Tuesday, May 19, 2009

Grails and Flex

Inspired by Christophe Coenraets' and Mark Fisher's NEJUG talk Spring and Flex Integration, I decided to try out the Flex Scaffold Plugin with Grails 1.1. This blog entry represents my findings to date:
  • Even though the plugin version is only 0.1.1, the plugin itself seems very well prepared and documented. I was able to get the example up and running with very little effort. Not bad considering at this time, I do not know much Flex.
  • The plugin makes full use of the Grails Domain objects when doing a generate, but does not seem to take advantage of the dynamic scaffolding for prototyping.
  • The current version supports a handful of widget types which correspond to Flex components. These components are the same basic functionality which is present with the standard Grails. Only the Flex implementation of input, Data tables, Tab Navigator, and auto complete is soooo much nicer.
  • The 'generate-all-flex' script places what we would normally consider controller methods {save(), list(), etc. in a Service rather than a Controller class. It seems like most of the Spring/Flex combinations work off the Service classes, but using the controller class would have been more consistent with the grails approach and would make it easier for existing applications to migrate towards Flex.
  • One very nice feature of Grails is the ability to edit screens and controllers while Jetty is running and to quickly see the results of changes. Not so using Flex and Grails. If you wish to make a change to a Flex based screen it is necessary to run the "flex-tasks" script first and then restart Jetty.

All in all, I still think Flex is cool. Grails and the Grails Flex Scaffold plugin still looks easier to work with than Spring, BlazeDS, and Flex. But it is not as easy to use as plain old Grails 1.1. I think Ezequiel Martin Apfel, the author of this plugin deserves kudos for putting together this plugin, and cannot wait to see what improvements he has in store for the future.