velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <>
Subject Re: Access public properties
Date Wed, 23 Feb 2011 20:04:52 GMT
I disagree.  My public fields are all final, immutable objects that are 
essential constants within the application.  Those in general should not 
be visible outside the application.  Therefore, having public fields 
hidden to templates gets my vote.

Instead of trying to anticipate any security concerns down the road 
about exposing a public field, just follow best practice and provide a 
getter method.  I think there is also a VelocityTool that exposes public 

Barbara Baughman
Systems Analyst
Information Security

On 2/23/11 10:42 AM, Thomas Vandahl wrote:
> On 18.02.2011 07:02, David Parks wrote:
>> I know getters/setters are good practice, but for internal stuff that 
>> won't
>> be extended I sometimes package things like compound return 
>> statements into
>> a simple object with a few public properties for easy access. Seems
>> reasonable that Velocity would check for a public property if the getter
>> isn't there.
> See 
> Bye, Thomas.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message