Generating Code vs. Generating Applications
First, I want to thank Steve for the link. He offers some interesting ideas. There are many paths to code generation obviously, and I only described how I did it, not how it must be done. Here are some of my thoughts to his suggestions...I like the use of the AdminAPI because it allows me to load the datasources when the app starts, which means that Flex also automatically populates the tables field which works nicely. It is true that it is not necessarily a required step.
DataMgr is an interesting option for getting the metadata and one I had not considered, though one way or another you still need to get metadata on whatever RDMS's you intend to support.
I also agree with Peter Bell that their are significant limits to using db metadata. It provides simply a limited starting point based only upon what the database knows - which is data type and size...it knows nothing of meaning or intent. XSLT also has significant limitations for round-trip code generation, thus my generator is designed to generate once and customize by hand.
I also want to address one issue because when speaking of ColdFusion and code generation, Peter Bell's name inevitably comes up (and for good reason). However, I think that when comparing the generator that Peter Bell is building to what I am building is a difficult one and can lead to some confusion. I am not picking on Steve for bringing this up, I am just taking the opportunity to add some clarification to my point of view when it comes to such comparisons.
Peter is building what he has referred to as a "software product line" where he builds upon the commonalities between his client projects and creates more meaningful metadata and ways of specifying a limited set of differences between his projects. By limited I am not implying a small set, just that in order for his generator to work it can only generate differences where there is an established means to specify them...thus their is always an inherent limit to what can be specified and new differences will require changes to the generator codebase - this is not the case with hand coding obviously. The overhead of building such a system is immense (I think Peter would freely admit that since his product is still a work in progress) and far beyond the scope of the day to day development work being done by most developers.
Another important distinction is that it also only takes into account a specific application architecture - for instance, in my current position we need to focus on Flex integration and java/WebLogic integration among other things - this isn't accounted for by default in the code generation that Peter discusses because it is likely not applicable to the applications he is building. This is not to say that a generator of the sort Peter speaks of couldn't be created to accomodate these architecture requirements (and others) but as I have stated this is no small task.
I am not saying this to be critical of Peter's work; I have been a big fan of his work for some time. I just think it is important to distinguish between the two very different paths to code generation - in fact, Peter calls his "application generation", while my generator is by no means generating an application...just some basic code that isn't even intended to "work" out of the box but is intended as a head start to your hand-coded application.
