Thanks Dave. The system I wrote before would generate stored procedures, and Cold Fusion Components for each table in a database (it would determine the tables and fields dynamically). It was originally built for Cold Fusion 5.0, but then modified for CFMX. With the 5.0 code, it can also create web forms, with the proper drop down lists for the foriegn key fields. It was never intended to build a complete system, but to crank out the mass of files/code needed to get the base architecture in place.
The next generation, I think I will have to write myself, and have already decided to extract and store the database model in XML. I didn't consider using XSLT for this, but can see where it might be handy. I don't know ruby, but do know PHP (some), so if I were to do this in an open source language, it would probably be a PHP command line script. I have some code in place already with VB.Net - I'm not sure if I will continue with .Net though. My goal is to create a system that isn't necessarily for a specific language, and can be expanded to include other languages easily. If/when I get this done, maybe I'll get you to test it out for me? I'd like to make some money off it, but also want to investigate making it open source. Just means a lot of work ahead of me for the code and maybe the business model. Shawn -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dave Lee Sent: Tuesday, March 30, 2004 12:05 PM To: CLUG General Subject: Re: [clug-talk] Open Source Template style code generator? Shawn wrote: > I have a project that I worked on some time ago that would read a database > format and then generate Cold Fusion code for talking to the database. > Basically it does the grunt work of getting the base code in place. I'm > looking at writing the next evolution of this that would handle any > scripting language (cuz I hate monotonous coding - doing the same thing > again and again and again for each table in the database), but thought I'd > take a look at what the open source world may have available. > > Thus far, there seem to be some products similar to what I want to do, but > costing $400+ per user. The open source products I found seem to be more > macros to generate code for you, but not necesarily based on a data model. > Does anyone know of any decent tools out there for this sort of thing? > Thanks. you might find something at: http://www.codegeneration.net/generators.php I think most of the model based code generators are commercial, with the buzzword-o-tha-day being MDA. also, I think most of the open source code generators are in the realm of macros, templates, and the popular roll-your-own codegen framework. I don't know of a de facto language, macro, or template system for doing code generation, people pick the language or template system that works best for them. I've done some code generation with xml/xslt, perl, and ruby. xml is mostly nice for describing models, but xslt 1.0 sucks. I'd recommend xml for model, and your xml processing language of choice. see this for using xml and ruby instead of xml and xslt: http://martinfowler.com/bliki/MovingAwayFromXslt.html Dave _______________________________________________ clug-talk mailing list [EMAIL PROTECTED] http://clug.ca/mailman/listinfo/clug-talk_clug.ca _______________________________________________ clug-talk mailing list [EMAIL PROTECTED] http://clug.ca/mailman/listinfo/clug-talk_clug.ca

