From: Marc P. <ma...@an...> - 2003-04-04 20:23:32
|
On Fri, 4 Apr 2003 15:06:08 -0500, <kea...@na...> wrote: > It seems like we discuss this issue every 6 months or so. > > My reply is that WMScript is *not* Java. While it uses the JavaBeans > naming > convention for property introspection, it does *not* use this convention > itself. > > WMScript is designed to be usuable by people who have no knowlege of > Java. > As far as possible it strives to hide the implementation details. So the > template author has no need to know that $Contact.LastName is actually > calling getLastName() on a com.foo.BusContact instance, or maybe just > get("LastName") on a Hashtable instance. Yes, I think this is great. It's just a bit problematic and in places contradictory... > If we did it the other way around, then references like $user.name would > be > resolved to user.getName(), user.get("name"), or user.name. This seems > OK, > but then what about $user.Name? What would be the accessor for this > property? I suppose we could reverse the case and look for > user.getname(). ...or getName(). Who needs two methods getname() and getName() to return different things? Nobody with their brain engaged... so resolving both to getName() as per Lane's suggestion would be a good idea I think... although there is the problem of it being strange behaviour. I mean, we could argue that all property lookups should be completely case insensitive on the basis that web designers should not have to understand the intricacies of Java. > Ultimately how WMScript properties are translated into Java properties is > a > question of style. The choice was made years ago, and it seems senseless > to > revisit it now. Yes, agreed. I was just searching for the logic behind it - in case there was any <g>. FWIW, using #bean somewhat muddies the separation from Java, especially as we call it a "bean" and then don't use the bean conventions ;-) -- Marc Palmer |