On 11/19/01 8:48 AM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:
> On 11/19/01 8:29 AM, "Henning P. Schmiedehausen" <[EMAIL PROTECTED]>
> wrote:
>
>>
>> And IMHO we already have a fair amount of guessing what
>>
>> $foo.Bar
>>
>> really means. It could be
>>
>> public String getBar()
>> public boolean isBar()
>> public String getbar()
>> public Object get("Bar")
>>
>> Quite a lot of meanings for just one innocent expression.
>
> Yes, I agree sort of. This is the problem with the whole 'support' of the
> bean spec, as it's meant for discovery of properties based on defined
> methods, not discovery of methods based on a hint about a property.
>
>> I wrote just last week, that I gave up writing the short cut
>> expressions just for the sake of not running into errors. I work with
>> velocity for about half a year now and I still make mistakes when
>> using $foo.Bar :-)
>
> I don't understand that one (if you are referring to the String thing...)
>
> However, I will admit to adoring the whole bit about not really knowing what
>
> $foo.bar
>
> Actually maps to - I exploit this all the time, being able to interchange
> objects in the context for a specific template, knowing it just has to
> support a property 'bar' *somehow*.
>
> I tend to think of there being a strict 'data contract' between me (the
> programmer) and the template, so I just stick to what I have agreed to, the
> implementation being up to me, the programmer.
An additional note : the cool thing about this (which I sometimes call
'introspective polymorphism'...), is that we support *two* kinds of binding
to the java objects :
1) precise, which tightly binds you to the method signatures of the object
placed in the context - you do things like
$foo.isBar()
$foo.getBar()
2) 'suggestive', which lets you agree on properties/data and leave the
implmentation up to the programmer
$foo.bar
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>