At 05:39 AM 11/4/01, brian moseley wrote:
>On Sat, 3 Nov 2001, Dave Rolsky wrote:
>
> > I don't actually object to having separate methods. My
> > point was more that a verb isn't always a good thing.
> > $cgi->get_param is really no clearer than $cgi->param,
> > _given_ that there is a known convention of not
> > prepending 'get_' to accessors. I don't mind prepending
> > 'set_' (or whatever) for set methods because I think its
> > a good idea to emphasize that something in the object
> > will change if you call that method.
>
>the verb can give a clue as to the type of attribute being
>accessed. ex:
>
> - getFoo, setFoo for strings, ints, floats
> - isFoo, setFoo for bools
> - findFoo, getFoos, addFoo, removeFoo for lists
>
>this can be quite handy for clearly understanding an api.
I agree. This is part of the argument I just raised (but is probably not
made it to the list yet) about being Bean-compliant. Of course,
Bean-compliancy (in Java) is only is, get and set methods. There is no
find, add, remove Bean-compliancy methods for objects representing lists.
Although perhaps there should be (for Perl beans)..If we even want Perl
beans which I am not sure what fully established.
Later,
Gunther