0

Have I told you how much I love Illudium PU-36 Code Generator?

ColdFusion

In case you haven't given a look at Brian Rinaldi's Illudium PU-36, do yourself a favor and do so. Out of the box, using a nice Flex front end, it introspects your database and can build concrete CFCs for your data model. Where Illudium goes so much further than some other CFC generators I have used is that it not only builds nice Bean, DAO, and Gateway objects (Foo.cfc, FooDAO.cfc, FooGateway.cfc), but it also builds in a service layer by adding in a nice FooService.cfc with some very useful built-in functions for getting a handle on your data.

but wait... there's more!

Even just the way that it builds the above so easily would be compelling enough to use this project, but it does much more. It creates configuration XML for ColdSpring, so that in about 30 seconds you can have a ready-to-go set of object CFCs that are already wired together using ColdSpring. Pretty awesome! That right there would make a great tool on its own beyond a shadow of a doubt.

this is getting ridiculous... even more!

Using Transfer ORM? illudium will generate your config XML for you, and even generate a decorator object to wrap around the bean. It is pretty amazing how fast you can put a Transfer data model together with it.

And the feature list just keeps on going. If you are working with Flex, it can create a Flex VO for you. It will also create a transfer object (TO).

One thing that Illudium does not do is manage data relationships, so there is no option for setting up hasMany/hasOne type relationships. After using ORMs heavily the past year and a half or so, I have gotten very spoiled by how easy it they make having child arrays/queries/iterators accessible through a bean... which brings us to the point that lead to this blog post tonight.

Illudium is so customizable!

I wanted to have a pattern throughout my data model where any object that has children objects has the following methods available (where "Bar" is the child object): Foo.getBarQuery(), Foo.getBarArray(), and Foo.getBarIterator() and a Foo.resetBar() to reload the child, and these children will be lazy loaded. When I started adding these to the generated CFCs I had to make some alterations to the generated Bean, Service and DAO objects. As we began using this pattern among our team we wanted to keep a consistent approach to these modifications to the generated CFCs. Not surprisingly, Illudium makes this super easy.

Within the Illudium code is a series of XSL files that serve as templates for how the code will be generated. Today, I modified it so that included with every Bean, Service, and DAO is commented code for creating "Foo" child object relationship.

Now I can generate a set of parent objects and generate a set of child objects. Then I do a replace on "Foo" in the code with the name of my child object and uncomment the example. Lastly I add a node for a ref bean of the child service in the parent service in my generated ColdSpring XML and that's it.

Quite literally in about 2 minutes you can have objects related in this manor.

Big giant props to Brian for all his hard work on this project!


tags:
ColdFusion
Tink said:
 
I rarely get to hook up to ColdFusion but this sounds like an interesting app.
 
posted 393 days ago
Add Comment Reply to: this comment OR this thread
 
Sam Farmer said:
 
I agree Dave, its an awesome tool.
 
posted 393 days ago
Add Comment Reply to: this comment OR this thread
 
Brian Rinaldi said:
 
Hey Dave, thanks for the write-up and I am glad it has been such a help to you. I would love for you to share the template changes with the mailing list at http://groups.google.com/group/cfcgenerator

Just to let you know, relationships is the main thing I am trying to tackle for a post 1.0 release. The issue to me is, I don't like foreign key constraints (to put it mildly)and I think they are a bad guide to object composition... Anyway, I have some ideas in the works, we'll see what pans out.

Thanks again.
 
posted 393 days ago
Add Comment Reply to: this comment OR this thread
 
John Allen said:
 
Just downloaded it. WOW!
IT IS AWESOME!
 
posted 384 days ago
Add Comment Reply to: this comment OR this thread
 
Brian Rinaldi said:
 
For anyone interested, I will be presenting on this today at 2 Eastern. You can get the details and URL here - http://www.cfframeworks.com/blog/index.cfm/2007/6/...
 
posted 384 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Dave at work...