Inheritance, constructor, destructor etc
| From: | Nick Panteleeff | Date: | Mon, 03 Sep 2001 08:47:47 +0000 |
| Subject: | Inheritance, constructor, destructor etc | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-1766@lists.php.net to get a copy of this message | ||
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