You are here: Re: Using a Resource as a Class Property « PHP Programming Language « IT news, forums, messages
Re: Using a Resource as a Class Property

Posted by Sanders Kaufman on 07/23/07 13:26

Jerry Stuckle wrote:
> Sanders Kaufman wrote:

>> I seriously considered writing the classes in a way to where the
>> parent would *presume* all kinds of stuff about the child, but it
>> didn't jibe with my obsession with atomicity - so I didn't do it.
>
> The child class defines the derivation, and therefore knows it has a
> parent class (and some things about that parent). However, the parent
> doesn't know if (or when) it is being used as a base class, so it should
> never assume things which may or may not be there (or set).

So - it's okay in the purist of OOP to have a child that presumes things
about the parent, but not t'other way 'round?

That makes a little better sense. I was kinda beginning to wonder what
use there was to having a child that couldn't (or shouldn't) talk to its
parent.

All of my classes talk with their parents, and I was thinking I might be
doing something non-OOP there.

Parent. Parents. Hmmm. That takes me to a new question - I understand
that a PHP class be an extension of more than one parent class.
(e.g. "class myClass extends oMommy, oDaddy") Are there any common
pitfalls y'all wanna warn me about before I start adding that way to my
mind's toolbox?

I haven't started doing it that way yet because I've only just started
doing OOP in PHP... but it stands to reason that I likely will, and soon.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация