You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "WATKINS, Andy, FM" <An...@rbos.com> on 2001/11/14 13:18:06 UTC

Introspection and upper/lower case

We're trying to be consistent with Java property names
accross our projects....
What is the best choice for upper/lower case?
I would like to use properties starting with a lowercase letter
but velocity examples all use uppercase.

Thus for methods

getNumberOfConnections() and setNumberOfConnections()

JSP:
on a class we access them via JSP as getProperty with property name
"numberOfConnections"

Velocity:
In velocity, can we use "lower case dot notation"
$server.numberOfConnections or
do we have to use uppercase as the velocity examples eg
$server.NumberOfConnections ?
If velocity expects UpperCase, this seems inconsistent with JSP and apache
BeanUtils...

XML Configuration files:
I would like to use XML to configure the startup state
of some of our components, perhaps using BeanUtils to automate
the mapping of XML attributes to method calls. Thus
we would use 

<server>
      <!-- this will call setNumberOfConnections -->
	<set-property name="numberOfConnections" value="5" />
</server>



Andy


********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
********************************************************************

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Introspection and upper/lower case

Posted by "Geir Magnusson Jr." <ge...@yahoo.com>.
On 11/14/01 7:18 AM, "WATKINS, Andy, FM" <An...@rbos.com> wrote:

> We're trying to be consistent with Java property names
> accross our projects....
> What is the best choice for upper/lower case?
> I would like to use properties starting with a lowercase letter
> but velocity examples all use uppercase.
> 
> Thus for methods
> 
> getNumberOfConnections() and setNumberOfConnections()
> 
> JSP:
> on a class we access them via JSP as getProperty with property name
> "numberOfConnections"
> 
> Velocity:
> In velocity, can we use "lower case dot notation"
> $server.numberOfConnections or
> do we have to use uppercase as the velocity examples eg
> $server.NumberOfConnections ?
> If velocity expects UpperCase, this seems inconsistent with JSP and apache
> BeanUtils...

The beanspec says that NumberOfConnections is the right token for something
with get/set.

However, for convenience, Velocity will let you use a lowercase 'n'.  That
is the second choice, as it tries to find a method

  getNumberOfConnections()

In the object first, and then

  getnumberOfConnections()


To summarize, it's your call.  Beanspec says 'N', and we support that.  Some
people want 'n', and we support that.

> 
> XML Configuration files:
> I would like to use XML to configure the startup state
> of some of our components, perhaps using BeanUtils to automate
> the mapping of XML attributes to method calls. Thus
> we would use 
> 
> <server>
>     <!-- this will call setNumberOfConnections -->
> <set-property name="numberOfConnections" value="5" />
> </server>
> 

?

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>