COM!

COM uses all of this kind of stuff (implemented in various ways through
inheritance, aggregation via template classes, proxies and delegates).

And why go to all this trouble?  So that your code can work with code
written by third parties that have no knowledge of your code, nor yours
of their code.

So it's really "just" interfaces then, but more flexible because you
are not limited to just implementing interfaces.

--Wez.

On 09/04/02, "Zeev Suraski" <[EMAIL PROTECTED]> wrote:
> 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




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to