I'm not saying you can't find a use for it, I'm sure you can. I'm saying that aggregation the way you use it is something that at least I have never seen used anywhere else before. I've never seen an object oriented program that is written without knowing anything about the classes it's going to work with, it doesn't make too much sense... or does it? In your example, I understand what it does, but I don't understand what's the advantage over MI in this case.
At 11:53 09/04/2002, Kristian Koehntopp wrote: >On Tue, Apr 09, 2002 at 12:11:11AM +0300, Zeev Suraski wrote: > > Having both makes very little sense. Compile-time vs. > > run-time in PHP doesn't make any real difference as far as > > functionality goes, because the stages are linked together > > immediately. > >Not the point here. In > >class D extends A, B, C ... > >the class names are static (determined at compile-time). In > >$classes = array("A", "B", "C", "D"); >$d = new Object; // Object is an empty class. >foreach($classes as $c) { > aggregate($d, $c); >} > >the class names are variables, and in fact, aggregate could and >should take an array as well as a string as the second parameter >in the first place. > >Kristian > >-- >Kristian Köhntopp, NetUSE AG, Dr.-Hell-Straße, D-24107 Kiel >Tel: +49 431 386 435 00, Fax: +49 431 386 435 99 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php