Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release")
| From: | Mika Tuupola | Date: | Sat, 31 Aug 2002 17:53:37 +0000 |
| Subject: | Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release") | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8797@lists.php.net to get a copy of this message | ||
On Sat, 31 Aug 2002, Markus Wolff wrote:
> On Sat, 31 Aug 2002 19:01:09 +0300 (EEST)
> Mika Tuupola <tuupola@appelsiini.net> wrote:
>
> > > So I guess it wouldn´t be too bad to introduce something like this to
> > > PEAR. Say, a common method "get()" for getting a string representation
> >
> > $foo->toString() ?
>
> That´s the way .NET names this kind of methods. On the other hand, many
> classes in PEAR already use get(), so making this the defacto standard
> will cause the least trouble/work.
Errr. Maybe I misread something. I ment get() methods to be
the accesssors and toString() method to return a string
representation of the class (and its state). IIRC its the
same way its usually done in Java.
> > print $foo->getXxx().
>
> Agreed, but some people are lazy, you know :-)
It is almost as much work to write a printXxx() method to
every property :)
--
Mika Tuupola http://www.appelsiini.net/~tuupola/