Code Generation
August 23rd, 2002 by HenI’ve got the code generation system I put together last year out of the cupboard, demothballed it a bit and used it to zap out some javabean business objects. Probably the worst thing about the system is that the implementations of each component are kept deliberately simple. That and the lack of a nice TUI, so it took me a while to remember just how to pass the data and config into the CodeGen front end.
The whole thing is meant to be pluggable, so replacing the pretend-script GJT with Jelly or Velocity would be nice, adding an XMI interface to the MMScript/XML and partial JDBC/CSV inputs would be nice, and adding Ruby/C# output would be nice.
Currently the system is a little Java-centric, but not in too many places.
I’m still not convinced Code Generation is a good thing. After a couple of years of specialising in it, I decided that runtime based systems that worked off of a live model were a better way to go. However, I do still find code generating to be a nice way to speed up the development process or even to look after a region of very similar code. I did 90% of the work for the String Taglib with the code generator.
