I've started some work on an extension of the GenerateMapBuilderTask 
to build not only the MapBuilder classes but also the Peers and
Business classes.  

To make it as flexible as possible I've "tweaked" a standalone version
of WebMacro to use templates for generating the classes.  Currently
it uses 3 Webmacro templates:

- A license template to expand the license into every class.
- A Peer template that contains all the fixed/duplicated code in a Peer
class.
 - A Data Object template that contains all the fixed/duplicated code 
that you normally have in a class that extends BaseObject and
talks to the Peer.  This class would include a method such as save().

As an example, If you had a Table called "Project" in your SQL
script, the Task would generate the following Java files:
 - ProjectMapBuilder.java ( just like Jon's current implementation)
 - ProjectPeer.java
 - ProjectDO.java

You could then extend ProjectDO and add any business specific methods.

For example - public class Project extends ProjectDO

This way, if your schema changes, you can re-generate the Database files
( MapBuilders, Peers, and DOs) and not lose that business specific code
you may have written in the Project class.
Anyone have any thoughts on this part ?

Hopefully, this will give us the flexibilty to change the
templates without changing hard coded out.println() statements, and
reduce a good chunk of work generating all the Database code.

I'm about a 1/4 of the way into this now.  But, I wanted to ping the
group and see if there's anything that I may be missing.   

-- 
dave
[EMAIL PROTECTED]
----------------------
< your inspirational quote here > 


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

Reply via email to