Being able to switch between a Property like object and a nice
Java object with gets/sets is very useful. Not only does it keep
implementation
separate from the GUI, but is means developers have much less reason for
using
FreeMarket and such (which allow these sort of Property attributes).


For us, the biggest issue is just documentation. If the documented
examples used "$foo.bar" everywhere then this is both consistent
with JSP and with the bean spec. 

How objects/Strings are cast is important, but perhaps is easiest solved by
logging $refs that fail to match with a message like...
"could not find property 'bar' on $foo having tried getBar(), getbar(),
boolean isBar() and Object get('bar')"

My 2c worth.

Andy

> 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.
> 
> 
> 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]

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to