velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson" <>
Subject RE: Velocity + Database [long]
Date Thu, 07 Aug 2003 14:21:12 GMT
Ted - 
  Thanks for that post - it was an eloquent way of explaining the Model
layer that I'll stuff away to send to other team members.

>  Hibernate 
> <http://> is my 
> personal favorite.

> But, sigh, I'm still looking for something that can "flatten" a rich 
> object Model into a simple transfer object, so that nested 
> objects look 
> like top-level properties (Person.Address.Street -> 
> Person.AddressStreet).

At one point, I had 'ViewBeans' which were essentially copies of just
the values from my biz objects (similar to Struts ActionForms) but this
involved a lot of copying properties and duplicated getter/setters.

I've taken another [hack] approach lately and added a
getViewableHashMap() method to my biz entities. This method places the
objects data into a flat hashmap for the preso layer. This also enables
the flattening to Person.AddressStreet, but it breaks down for nested
collections. Ex. if Person contains a collection of addresses and we
call Person.getViewableHashmap() -> do we expect the data from just
Person, or also the list of addresses? And then if an Address contains a
recursive Person object, we must prevent going infinitely deep.

This brings me to my question - what have other folks [who are not just
placing the POJO into the context] doing?

Just curious.


View raw message