Ever get one of those "if only it could do this" urges when using somebody else's program, and suddenly you are rebuilding the entire thing? I have, and because I like to tinker it usually leads to trouble.
In this case the application was Brian Rinaldi's Illudium cfcgenerator tool, a most excellent tool for converting your database tables into and MVC framework of cfcs, aka. Service, Gateway, DAO and Bean (plus extras). Even though I use it all the time, I have a couple issues with it. First, it is Flex-based: cool, but I don't *do* Flex anymore so that wasn't a plus for me. Second, it uses XSL, which is cool but not fully realized in CF (i.e. not all functions are supported) and if I can avoid learning yet another technology that I don't otherwise use then I am a happy man. Third, and most importantly (for me), you only get one shot at building your beans. I for one like to develop in an iterative process, and Illudium isn't going to respect any changes I've made to my cfcs.
So, I had one of those moments on the Easter long w/e where I was modifying a database for an application and realized that because I'd already generated the MVC model already, I'd have to do my cfc updates manually. Ugggg! This time I decided that instead of spending 2-3 hours updating the cfcs by hand, I'd rewrite Illudium. I've been using jQuery a lot lately, and couldn't see any reason I couldn't do a version in fairly short order. Luckily it was pretty straight forward (especially thanks to having Illudium handy for some of those trickier table-parsing queries).
The goal was to create a version that a) was entirely CF-based, with jQuery building the interface, b) that it would be able to not only generate new cfc sets, but also update existing ones, and c) that it would support templates. I also threw in some way-I-do-it things as well (such as generating a single ColdSpring doc for all the cfcs, and putting each table set into its own directory). There's some other baked-in functionality too, like automatic archiving of existing cfcs, and 'saving' of settings for a particular table. I've also set aside XSL for simpler (and admittedly less elegant) cfm templates.
My version (which I've provisionally called q36, an inside joke for anybody who gets the Illudium inside joke) works by putting markers around the table-related bits of information in the cfcs. For instance, in the 'Service' template you would see (tildes at the beginning prevent CF from processing the template code):
The ~!---^^ATTRIBUTES-START^^---> and ~!---^^ATTRIBUTES-END^^---> tags are used by q36 as markers to insert the next bit of code:
... which finally leads to:
Because all of this code has been segregated into its component parts, q36 won't overwrite any changes you've made to a targeted set of cfcs.
As mentioned, it will automatically zip up existing directories if they exist (no 'woops' moments here), and there is rough support for templates. I use jQuery UI to build the tabs, and the rest is plain old CSS 3. Other than that, it performs pretty much exactly as Illudium does.
So, I've put in about a day and a bit's work on this tool, and if there is any interest in it I can clean it up and make it available to the community. So far it's only been tested on CF / Windows / MySQL, but I'll round that out a bit too if the community at large thinks it worth pursuing. Of course, I'd also need Brian Rinaldi's approval, since the queries for extracting information from the datasource's are almost entirely from his work. Oh, and for those who are curious it is built using FW/1 as well.
Let me know, and feel free to post suggestions/updates that you'd like to see included. Again, I'll only release this if Brian approves (and he's included code donated from others, so it might be a chain-of-approval thing).