velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: Velocity + Database
Date Fri, 08 Aug 2003 12:25:08 GMT
Charles N. Harvey III wrote:
> Would you mind letting me know where you found such a system?
> I am using OJB and I have been looking at Torque, is that what you
> are using to do all this code and database generation?  If not, I would
> love to find out (if it is publicly available).

Hibernate is another good example. The mappings between the Application
Model objects and the database tables are expressed in XML. Internally,
the Java code just asks Hibernate for such and such an object; there are
no references to SQL at all. Externally, you can make very significant
changes in the way the objects are stored in the database without making
any changes to the Java code. The XML needs to be parsed again, but the
Java code does not need to be recompiled.

I'd love to be able to do the same sort of thing between transfer
objects and the Application Model. From the page's POV, most input and
output queries should appear as a flat object, or a flat object with a
few shallow lists.

Of course, you can pass the Application Model objects directly to the
page, but, IMHO, that creates the same sort of binding we're trying to
avoid with the database system. It could be quite useful to declare in
XML how to convert a rich Application Model object to a shallow transfer
object in XML, just as many systems now let us declare how to store a
rich Application Model object to a relational database.

-Ted.


-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.





Mime
View raw message