Common method names part 2
| From: | Mika Tuupola | Date: | Thu, 19 Sep 2002 21:00:56 +0000 |
| Subject: | Common method names part 2 | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-9231@lists.php.net to get a copy of this message | ||
There was an thread about common method names (maybe to be
included in CS) in PEAR classes. Method names such
as connect(), disconnect(), getXxx(), setXxx() were mentioned
then.
What would be a good common name for "constructor" method.
I mean in the cases when this "constructor" returns instance
of itself _or_ an PEAR error. You could allways set $this
to PEAR_Error in the real constructor, but AFAIK this might
not work in the future.
Is factory() considered suitable in this situation, since
it is interface for creating objects, _but_ is usually used in
situations where it returns instance of some concrete (driver)
class (suchs as DB_mysql or friends)?
Other possibilities: init(), constructor(), ...
--
Mika Tuupola http://www.appelsiini.net/~tuupola/