You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Tim Colson <tc...@cisco.com> on 2003/02/26 07:33:52 UTC

RE: [OT] Scrollable ResultSets, was: RE: new to the list, new tovelocity...

> I ain't gonna tell you your business ;) But using the 
> JavaBean paradigm allows easier reuse of these type 
> of DB-related objects, say  in struts,
> JSTL, or anything else like that.

Heh heh. I've been "re-using" hashmaps ever since coming over from Perl.
;)

> This syntax would still be used, as JavaBeans have get/set 
> methods for  all properties, and would allow more universal usage.

By all means create javabeans if that makes you happier. :-)

I often have values that I want to expose to the template, but don't
have a great reason to turn them into a bean property, and/or I don't
want to mess with creating a bunch of extended classes just to add
custom properties.

For example: 
Show a list of Project overview objects which have ID, ProjectName,
ProjectDescription, DetailLink. Maybe I need to add in boolean flags for
HighlightMe and ShowDeleteButton. 

My controller will come up with the biz logic to determine if those
flags are True/False and may have nothing to do with the Project Object.
Even the link isn't part of the biz object, and it changes based on the
status of the user (logged in or not). 

So I dig the hashmaps because they can give me a lightweight container
for just the read-only info I want to expose to the template, along with
extra stuff that may not be part of the object proper. 

As for working with JSTL and Struts tags... uh... well, I think the map
actually might work in JSTL, but uh... I use Velocity not JSP. :-)

But do whatever floats yer rubber ducky. ;)  

Cheers,
Timo

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org