Automated Flex Project Generation

June 17th, 2008

After reading the book Code Generation in Action I found I was in need of an simple and easy way to roll out Flex project foundations.  I create a script that works with a set of template files to build the standard project directory structure, a set of specified views, and a set of basic commands that add the views to a canvas and init the application.  The following shows the command line invocation of the perl that creates a Flex project with 5 separate views :

# ./generate.pl  usage : generate.pl domain applicationName view1 view2 .. view98 view99

# ./generate.pl extralongfingers mynewapplication helpbutton startbutton stopbutton extralongfingersbutton holymountbutton 

After that runs we have a set of directories that looks like this :

 Flex Generation Directory Structure   Each view specified on the command line created a mxml file in the root directory of the namespace and a corresponding controller in the com.extralongfingers.mynewapplication.client.controllers directory.  If you run the script you will see that each mxml view registers itself with the controller that shares its name.  The script also creates an application mxml file call Mynewapplication.mxml in the root of the directory structure. This mxml application serves as the entry point for the app and proceeds to run the BuildViews Command upon initialization wherein all the mxml views are instantiated and proceed to link up with their controllers.  I'm planning to clean up this perl a bit in order to modularize things a bit more and hope to submit to cpan soon.  Let me know what you think and if you found this useful.  I've been doing a lot with code generation lately so come back soon for my AMF PHP remoting gateway generator.         Flex Generation Framework Source

Tagged:

§ One Response to “Automated Flex Project Generation”


  • Fatal error: Call to undefined function: get_avatar() in /home/content/e/l/g/elgrumpy/html/wordpress/wp-content/themes/oulipo/legacy.comments.php on line 30