Getting Started With Code Generators - Part 1
Posted By : todd sharp Posted At : February 12, 2007 10:15 AM Posted In: Code Generation, Project Learn, ColdFusion
4
So the first post in my series will focus on installing the first code generator that I plan on evaluating. The Illudium PU-36 Code Generator by Brian Rinaldi. Rather then try to creatively come up with a better description then Brian's I'll just quote the description from the project page:
This project generates ColdFusion components (i.e. bean, DAO, gateway, service), ColdSpring XML, Transfer XML, and ActionScript Value-Objects using the admin api and database introspection. The front-end is built in Flex 2. The code outputted for easily pasting or saving into a project to allow you to get a headstart on some of the gruntwork of doing OO in CF. It uses XSL to generate the components and is designed to allow you to easily add to or modify the generated code. You can even create new templates that can be swapped out at run-time.
The first step is to download the tool. There are two options - vanilla (HTML) or chocolate (Flex - yummy). (OK, they're really not called vanilla and chocolate, but I'm taking some creative liberties). I've checked out both versions before - very briefly mind you - but for this go 'round I'm going with the super sexy Flex version.
Step 2 isn't much harder - install the generator. Again I'll quote from the project page:
1. Copy the contents into a directory name "cfcgenerator" under your web rootNOTE: If you need to place it elsewhere, a mapping should work, but you will need to edit your webroot\web-inf\flex\services-config.xml and set
true 1. Set your ColdFusion administrator password as the value of adminPass in Application.cfm
2. That's it!
There was one minor tweak I had to make to get the flex generator to run. The Flex version zip is packaged as /cfcgeneratorFLEX - but some of the createObject calls point to /cfcgenerator. A simple global find and replace on cfcgeneratorFlex (and change the name of the root folder) seems to do the trick. I've filed a bug on this.
So now the generator is installed. Simple stuff that's for sure. In my next post I'll talk about getting into the tool and generating some code.
Update: After talking with Brian it seems that the version that I obtained from Google Code was old - the new and most recent version is available at RIAForge. You can find it here: http://cfcgenerator.riaforge.org/


