Re: Re: aggergate vs MI
| From: | brad lafountain | Date: | Sat, 06 Apr 2002 21:40:30 +0000 |
| Subject: | Re: Re: aggergate vs MI | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-82219@lists.php.net to get a copy of this message | ||
--- "Stig S. Bakken" <ssb@fast.no> wrote:
> On Sat, 2002-04-06 at 11:21, brad lafountain wrote:
> >
> > --- Yasuo Ohgaki <yasuo_ohgaki@yahoo.com> wrote:
> > > Brad Lafountain wrote:
> > > > I keep on hearing that "we" are totally against MI but "we"
> > > > want the
> > > aggergate
> > > > function.
> > > >
> > > > Can someone PLEASE explain the reasoning behind such a decision?
> > > >
> > > > I can't think of one example when aggergate would be better than using
> MI.
> > >
> > > Aggreation works now. Multiple inheritance needs changes in ZendEngine.
> > I am more than willing and capable to make such changes.
> >
> > >
> > > BTW, some user asked multiple inheritance feature to php-dev, I replyed
> > > "Multiple inheritance is useful, but it makes a lot easier to design
> > > objects badly. I think we are better to design objects so that
> > > multiple inheritance is not needed"
> > This is somewhat true, but how does aggerate fix this?
> >
> > >
> > > Then I got reply, "multiple inheritance is needed", etc, etc, but
> > > nobody support my idea. Therefore, most of developers like multiple
> > > inheritance, I suppose.
> > I like MI way more than i like aggerate.... I honistly think, as far as OO
> is
> > conserned, aggergate is garbage.. imagine reading someone elses code...
> trying
> > to figure out what objects do what... and you come opon line 150 where
> > aggerate($circle, "Square");.. seriously.. IMHO this is garbage!
>
> So? What if the object is overloaded? What if it's some proxy class
> and you don't even have _access_ to the code of the methods it would
> call? If people want to design shitty code, they will be able to with
> or without aggregate.
>
> > Unless someone could give me a real reason that aggerate is better than MI.
> I
> > would consider aggerate a HUGE downfall of php!
>
> MI is compile-time, aggregate is runtime. That's a big enough reason
> for me.
I know the difference but how does this benifit you?
>
> > Class definition is defined at design time not run time!
>
> Aggregate is not really about class definition. The shortcut in the
> current implementation modifies the class definition, but in its basic
> form, aggregation is about forwarding calls, not about changing class
> definitions. Thus my suggestion to change aggregate as in my first
> reply to Kristian.
Ok... Can you give me a good example that aggergate would be used over MI.
That makes sence and isn't garbage code!
--brad
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/