velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: [VelStruts] FieldMethodizer() question
Date Mon, 11 Mar 2002 16:32:01 GMT
On 3/11/02 11:11 AM, "Tom Bednarz" <list@bednarz.ch> wrote:

> Hi,
> 
[SNIP]
> 
> I have to put two times the same object in the context: once the object
> itself and once passed into the contstructor of FieldMethodizer().
> Is there no way to avoid this unnecessary overhead?
> 
> The FieldMethodizer introspects the object and finds all public static
> fields. Why this cannot be done automatically by velocity when introspecting
> the public methods?

We made a decision that we weren't going to expose fields directly, but
'coax' people to use setters/getters.


> Constants are different from non-constant public fields
> (which should not exist in proper OO design). But constants are made for a
> better code readability (instead of lots of magic numbers) and easier code
> maintenance. It is good programming style to use constants and therefore I
> personally think they should be supported in Velocity directly (without the
> FieldMethodizer() tool.)

Ok - it's a good argument, and noted.

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
The obvious solutions are challenging


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


Mime
View raw message