Re: Using a Resource as a Class Property
- From: Sanders Kaufman <bucky@xxxxxxxxxxx>
- Date: Sun, 22 Jul 2007 23:25:43 -0500
Michael Fesser wrote:
Quite simple: A base class with a member variable and a method that
performs some action with that. Since this is done in the constructor,
every child class has to be able to initialize the data before calling
the parent constructor, as you can see in B::__construct(). If PHP would
automatically call the parent constructor, this would be impossible.
So extended (child?) classes MUST NOT (for OOP reasons) automatically call a constructor. Rather, it should be called manually, if and when it's desired.
And this is not unique to PHP.
Zat right?
(Scuse me if I'm being dense, but I got some head stuff going on.)
.
- Follow-Ups:
- Re: Using a Resource as a Class Property
- From: Jerry Stuckle
- Re: Using a Resource as a Class Property
- From: Toby A Inkster
- Re: Using a Resource as a Class Property
- References:
- Using a Resource as a Class Property
- From: Sanders Kaufman
- Re: Using a Resource as a Class Property
- From: Michael Fesser
- Re: Using a Resource as a Class Property
- From: Sanders Kaufman
- Re: Using a Resource as a Class Property
- From: Michael Fesser
- Re: Using a Resource as a Class Property
- From: Sanders Kaufman
- Re: Using a Resource as a Class Property
- From: Michael Fesser
- Re: Using a Resource as a Class Property
- From: Sanders Kaufman
- Re: Using a Resource as a Class Property
- From: Michael Fesser
- Re: Using a Resource as a Class Property
- From: Sanders Kaufman
- Re: Using a Resource as a Class Property
- From: Michael Fesser
- Using a Resource as a Class Property
- Prev by Date: Re: Using a Resource as a Class Property
- Next by Date: Re: Using a Resource as a Class Property
- Previous by thread: Re: Using a Resource as a Class Property
- Next by thread: Re: Using a Resource as a Class Property
- Index(es):
Relevant Pages
|