Re: Inheritance, constructor, destructor etc
| From: | (Stig Sæther Bakken) | Date: | Mon, 03 Sep 2001 09:08:23 +0000 |
| Subject: | Re: Inheritance, constructor, destructor etc | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1767@lists.php.net to get a copy of this message | ||
What you're really asking for is that every class should have a
constructor, or at least every class that is supposed to be
"instanciable". I think that's reasonable.
But until the PEAR class is rewritten in C, bundled with PHP and
statically linked in every build (this is the plan), I really want to
avoid forcing people to inherit the PEAR class. Encouraging is
okay. :-)
- Stig
[Nick Panteleeff <drnix@svinsurance.ru>]
> Why not make by required inheriting of all new base classes
> from PEAR (may be excluding factory)?
> I see there is a some classes, which have no parent... Well,
> we allow that these classes do not require the
> Óonstructor/destructor mechanism... But how to be with
> derived classes, which can be realized in the future, and
> which needs it? And plus the mechanism of error handling,
> which can appear another...
> And still, IMHO would be correct, that each class had the
> own constructor, even if it will contain only one call of
> the constructor of a parent. It will allow to avoid some
> tangle, what constructor be call:
> for example:
> PEAR (have constructor)
> class1 (have constructor)
> calss2 (not have constructor)
>
> Well, I make class3 and I need constructor/destructor...
>
> class3 extends class2 {
> function class3 ($someparam) {
> // $this- > class2 ();??? It would be natural...
> // NOT!!!
> // I am forced to examine source class2, class1 and
> only there to detect right answer
>
> this- > class1 ();
> ...
> }
> ...
> }
>
> BR
> Nick Panteleeff
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Stig Sæther Bakken <ssb@alltheweb.com>
Fast Search & Transfer ASA, Trondheim, Norway