--- Zeev Suraski <[EMAIL PROTECTED]> wrote: > At 00:55 09/04/2002, brad lafountain wrote: > > Well i would have totally agreed with you yesterday.. but i have convinced > >myself that there is use for aggregation. Me personally i would never use > it. > >But i can see somepeople using it. > > It doesn't mean it's a good idea to add it. I used both, and yes, > aggregation makes sense in some cases, but having them both in the language > is like a supermarket of everything, and that's never good. > > >But giving the user a way to "MI" without having "MI" support(aggregation) > >will > >create alot of messy code. It wont even give the user a change to write > >good OO > >code. > > > >Can you explain why you can't see room for both of them? > > Aggregation is typically supported in userland, in the rare cases where > it's really required (through wrapper methods that relay calls to a member > object). Having them both will confuse people. Even people with some OO > experience won't find it trivial to decide which they should use.
But do you see my point that having ONLY aggregate means that in 90% of the case where people will use it its probally a bad idea. They are only using it becuase of the lack of MI. How does aggregation solve overwriting methods. class a { function blah() { echo "in a"; } } class b { function blah() { echo "in b"; } } class c { function blah() { echo "in c"; } } class d extends a,b,c { function blah() { echo a::blah() . b::blah() . c::blah(); } } how do you do that with aggregation? MI really is way different than aggregation. I see aggregation used for adding methods to an existing class. class a { function do_a() { } } class b { function do_b() { } } $c = new stdclass; aggregate($c, "a"); aggregate($c, "b"); $c->do_a(); $c->do_b(); but i still don't like this... there are cleaner ways around that by using members and/or MI. - Brad __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php