velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fahrmeyer" <>
Subject AW: introspection 'enhancement'
Date Fri, 02 Feb 2001 08:34:54 GMT

I asked for that ;)

It's a very flexible approach, but is it not too complicate ? The Bean spec
says that after a "get" or "set" (in a method name) must follow a uppercase
letter. So expect that a method in this signature is defined. And now just
convert the first letter of every property to uppercase and lool up the

I think that makes the designer life easier and the programmer knows what he
have to do anyway (mostly) ;)

It's just very nice to write $ instead of $user.Name


> -----Ursprungliche Nachricht-----
> Von: []Im Auftrag von Geir
> Magnusson Jr.
> Gesendet: Donnerstag, 1. Februar 2001 19:29
> An: velocity-dev; velocity-user
> Betreff: introspection 'enhancement'
> I added a small fix to the 'case sensitivity' of properties, as this was
> recently discussed sort of :
> If you have a method
>    getFoo()
> and in your template you do
>   $
> we will try getfoo() first, and then getFoo() if getfoo() isn't found.
> And in the interest of symmetry, we do the reverse.  If you are wierd,
> and have a method
>   getfoo()
> and your designer has a clue :
>   $bar.Foo
> then we try getFoo() first, and then getfoo() second.
> I am queasy a little about this, but even queasier about not having it,
> and someone is going to ask for it anyway :)
> Note that the best strategy for performance is to get it right, to limit
> the amount of expensive introspection...
> Note also that I believe this is an inversion of the bean spec, rather
> than a literal reading.  As I read it, the bean spec talks about this
> when dealing with naming a property that it finds a pair of matched
> getter/setter methods.  We are going the other way, finding the
> getter/setter methods given a property name.
> (I will make set work the same way....)
> geir
> --
> Geir Magnusson Jr.                     
> Velocity : it's not just a good idea. It should be the law.

View raw message