From: Lane S. <la...@op...> - 2003-04-04 04:57:18
|
A bean implements accessors and mutators as get|set{PropertyName} and that WebMacro follows this pattern to resolve the public method with a caps on the property name. Alternatively, you can access the member as $instance.name and $instance.description if the instance is declared publically. Finally, you can access an object in a map as $map.marc or $map.Marc and it will resolve properly both if either exists so there has to be some flexibilty in allowing both cap types to co-exist. Right? -Lane Marc Palmer wrote: > > Hi, > > Can anyone remind me exactly why WM breaks the Java Beans spec. with > respect to capitalisation of properties? > > i.e. if you introspect a bean and get the following properties: > > name > description > > ...to access these in a template you must write: > > $bean.Name > $bean.Description > > This looks "nicer" to e of course, but the break from the beanspec is > a pain in the ass, and is no doubt responsibly for quite a lot of > messaing around in the introspection code in WM where everthing will > have lower case first letters. > > I've written a BeanInfoWrapper that dumps into a template all the > useful info about an object. This is being used in the webapp's help > syste so any java object put into the context can potentially be > introspected and help shown. However what you get back is not very > useful unless a xxxxBeanInfo class has also been written, in which > case you get plain english descriptions of the object, each property, > what every method does and what the parameters are called and what > they do. > > ...but I'm going to have to make it capitalise all the property names > for it to make sense ;-( > > Oh, and my colleague has nearly finished the simplified XML access > helper - already I have most of an RSS news feed included into a demo > template without too much trouble. We have some caching fun to do > though... but I will mail about that separately. > > Cheers -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga Java Software Portal: http://opendoors.com |