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).


Apr 6, 2010 at 2:08 PM Looks great. Is there a beta for testing? MS SQL would be helpful if you feel so inclined.
Apr 6, 2010 at 2:18 PM Sounds like something for Github if Brian approves :-)
Apr 6, 2010 at 3:14 PM @Mark no beta yet; I only built it yesterday so this is more of a "does anybody else use/want/need this" kind of post to determine if it is worth putting the work into building a releasable version.
Apr 6, 2010 at 3:41 PM Sounds great, I sure want/need this!
Apr 6, 2010 at 7:34 PM Sounds fantastic, would love to see this. I use illudium a fair bit but have always thought a non-flex version would be handy.
Apr 6, 2010 at 11:11 PM Wow, you really did have a productive weekend!
Apr 7, 2010 at 2:10 AM Looks promising, let us see more if Brian approves...
Apr 7, 2010 at 7:14 AM Awesome! To be honest, the Flex UI on that is showing its age and has long outlasted its usefulness. Let's discuss perhaps rolling this into an update?
Fwiw, I think if Illudium is going to survive it would need to run better inside ColdFusion Builder...but that's a whole other discussion.
Apr 7, 2010 at 8:36 AM Umm . . . yes, I'd love to see this happen!
Apr 7, 2010 at 9:11 AM @Brian Awesome back at you!
@All, I've sent back an Email to Brian to discuss rolling the update. I'll keep readers informed of the progress.
(And yes, doing this straight from CFBuilder would be a treat)
Apr 9, 2010 at 9:57 AM does this incorporate the changes that Dominic Watson made to Illudium in his nextgenerator tool (i.e. Railo support)?
Great Work, thanks a lot
Apr 9, 2010 at 10:51 AM I should clarify; this impulse project of mine didn't add to or modify Illudium; I just got the urge to build it myself from scratch and this was the result.
The only thing I took from the original Illudium was in mimicking the general UI layout, and two queries that gather the meta data from MySQL. Literally *everything* else is brand new (parsing, template structure, etc.). I wasn't even referencing how anything was done in Illudium when I wrote it, so the whole code/application structure is probably radically different.
In the end the output is almost exactly the same, though I didn't include the Bean validation section (I don't do validation in the bean) and I added a couple of extra functions ('beanExists' via a tag-on query param, and a Gateway function that returns a single bean via arguments). Like Illudium it is entirely template-based, so adding the validation back in would be easy.
All that being said, I can confirm that it does run on Railo.
FYI I am cleaning the code up and completing the last few bits, then shipping it off to Brian for a review. As I said, this is all new code so whether he wants to incorporate any of it into his project will be up to him. At the very least I'll release it as a derivative work under the same Apache GPL license as Illudium.