From: <kea...@na...> - 2003-04-04 20:06:23
|
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. 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(). 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. Keats > -----Original Message----- > From: Marc Palmer [mailto:ma...@an...] > Sent: Friday, April 04, 2003 1:38 PM > To: la...@op... > Cc: web...@li... > Subject: Re: [Webmacro-devel] Capitalised properties in WM, why?! > > > On Fri, 04 Apr 2003 07:53:49 -0800, Lane Sharman <la...@op...> > wrote: > > > I think we had a discussion about this some time ago and I voiced a > > similar concern. You can today say $instance.value to > obtain a bean value > > but the member will have to be public. I would imagine it would be > > possible to add a heuristic: > > > > search object.property --> object.getProperty(). > > Yes maybe we should. I can appreciate that most people using > WM would be > completely unaware of the javabean mnituae in this respect. > > There might be complications where get(Object key)/set(Object > key, Object > value) is used. > > Anyone else got thoughts on this? -- Marc Palmer > |