I mentioned awhile back about building on to the DataBaseMapBuilderTask
to have a Ant task that would also generate the Peers and DataObjects
from the DB schema.  Since some of you expressed an interest in this I
thought I'd give you an update where it's at:

The initial idea was to use WebMacro templates to write the code.  The
Ant task would pull the TableMap into memory ( generated from the
schema), iterate over the TableMap for each table entry, stuff the
information into a WebMacro context and write a MapBuilder, Peer, and
DO object to disk for each table entry.  This would mean using WebMacro
in standalone mode to write the files to disk.

After some initial experimentation here's what I've found:

Using WM templates for the DB related code would work, however there's a
lot of issues with things such as semi-colons, braces, and dots ( such
as myclass.peer ) that cause problems in WM templates.  I went as far
as creating special context tools to compensate for these problems, but
the resulting templates were hard to read and ugly. 

So, i back peddled a little and added on to the DatabaseMapbuilder class
to enable it to write the Peer classes ( that's as far as i've got so
far) using out.println(). But I still believe the template path is the
way to go and am relunctant to spend more time on the out.println()
stuff knowing that templates would be better in the long run.

Ideally, i think this tool should have a GUI for graphically
creating the classes.  My main motivation for this is from using
the DODs tool for the enhyrda project. ( www.enhydra.org). I've even
went as far as looking at DODs ( since it's LGPL ) to see if we could
"hack it" for Turbine.  Maybe, Argo UML could be adopted for the GUI (
don't know much about now though) 
Any thoughts on this?

Another alternative would be to roll up our sleeves and write a parser
( this is not to difficult to add in at first glance) for WebMacro that
would meet our needs.

I think this tool would be a valuable ( and needed )  addition to
Turbine.  But, before I go farther I wanted to get more input/ideas 
from all of you.  

Here's some of the issues we face in doing this:  
* Dealing with the small differences in schema between databases.
* What's the best way to initially populate the TableMaps - from schema
or an XML file.?
* Should we use templates or just println()?

My main reason for this lengthy e-mail is that I don't want to devote a
lot of time to a tool that's only useful to a portion of Turbine users
( for example MySQL ). I feel if we spend this much time on it, it
needs to be done right so it doesn't end up hidden down in the utils
directory where the average user won't find it and use it.

Please give me your thoughts on this if this interests you at all. 
Maybe then we can collectively come up with the best approach for doing
this.

  -- 
dave
[EMAIL PROTECTED]
----------------------
Just your average Joe armed with an Emacs editor.


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to