Illudium Flex Remoting Templates

I'm probably the laziest programmer on the face of the planet. As such, I am habitually looking for shortcuts and the fastest ways to accomplish things within the scope of all that I consider "acceptable" programming practices (a shockingly lax set of self-imposed development guidelines). For this reason, I spent the better part of the day customizing some Illudium PU-36 Code Generator templates to produce CRUD components for Flex development. Why would I do this, you ask? Because the ColdFusion Application wizards are not supported on the Mac platform and I spend at least 30% of my coding time writing the CFC interfaces needed by my Flex applications. The templates essentially create the same type of CFC files that the Windows version of Flex Builder generates. The resulting components are nearly identical to the default components that Illudium supports "out of the box" with a couple of exceptions. They have been slightly modified to support Flex RemoteObject calls. The code also instantiates objects in a slightly different way so that Flex can run everything through the Service CFC that Illudium creates. If you've used the CF application wizards on the Windows version of Flex Builder, the Illudium generated version is very similar (but better, I think) to the components created by it.

The enclosed zip file contains a folder that you should copy to your xsl\projects folder at the root of your Illudium directory. A new Template type entitled "FlexRemoting" should appear in the drop down box when you run Illudium. Point Illudium to your database table, choose the FlexRemoting template type, enter your dot notation to the CFCs (as they will be referred to in the RemoteObject function in Flex) and click the "Generate" button. Four files will be created (Bean, DAO, Gateway, and Service). Once you save these to the appropriate folder in your Flex project directory, open the Service CFC file and go to the bottom of the file. Find the function named "initCRUD" and replace the DSN place holder with the actual DSN you'll want to call with your components. Then, simply point your Flex RemoteObject (get, create, save, delete) functions to the appropriate function in the Service CFC.

Illudium appears to be a great tool and it has the potential to save substantial time when coding Flex applications if you, like me, don't have access to the full suite of ColdFusion extensions within Flex Builder. The FlexRemoting templates are my first attempt at customizing Illudium since I've only been working with it for about a day. If you have any recommendations as to how the templates could be improved, I'd love to hear them.

Comments
Brian Rinaldi's Gravatar Excellent! I look forward to trying these out.
# Posted By Brian Rinaldi | 4/11/08 11:35 PM
Michael McConnell's Gravatar A couple of things I neglected to mention - I modified the CFC create and update functions (called by the Service CFC and initiated by the DAO) to return the table record identifier to the Flex eventhandler so the record could be highlighted in the Flex application, if needed. I also forgot to mention that Illudium generates a VO file (the data model) that your Flex app will need to use as the model. This file is unmodified by the FlexRemoting templates and produces the same result as the default Illudium template.
# Posted By Michael McConnell | 4/11/08 11:57 PM
Michael's Gravatar Brian,

I can't thank you enough for this excellent tool. I'll be paying a visit to your Amazon wish list.

M. McConnell
# Posted By Michael | 4/12/08 12:01 AM
Brian Rinaldi's Gravatar No problem and thanks! Also in case you missed it I posted a new build that fixed a minor bug and added some new database support the other day. Feel free to share any feedback you have from using it.
# Posted By Brian Rinaldi | 4/15/08 6:33 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9. Contact Blog Owner