Re: PHP 5 Question about OO
| From: | Jochem Maas | Date: | Wed, 01 Jun 2005 10:41:04 +0000 |
| Subject: | Re: PHP 5 Question about OO | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216137@lists.php.net to get a copy of this message | ||
eoghan wrote:
maybe have a look at extends.... class Class1 extends Class2 {...he will still have to make sure that Class2 is loaded. besides wrapping 1 object inside another is perfectly acceptable, if my GOF terminology serves me well then this is usually termed a Delegation pattern (not that the name is that important, then again it helps to be talking about the same thing :-/).
janbro wrote:Hi List, I'm using the oo orientation of PHP5 for a while now. All Classes I've got have a require on top them, if I try to reference to other classes. something like require (Class2.php); class Class1{private function ... { $refClass2 = new Class2; }} Now my question, is it possible to skip that require/ include part? In Java you don't need that, as class and file names are identical. thx janbro