--- Zeev Suraski <[EMAIL PROTECTED]> 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. > I don't think MI will make it into PHP, now that aggregation was > introduced...
Yes it does make sence. How much slower would the code below run, not to mention how hard it is to read or maintain. class a; class b; class c; for($i = 0;$i < 10000;$i++) { $d = new a; aggregate($d, "b"); aggregate($d, "c"); $d->method(); } or this class a; class b; class c; class d extends a,b,c; for($i = 0;$i < 10000;$i++) { $d = new d; $d->method(); } Its all about desiging your objects.. if d always consits of a,b and c then MI should be used. If some condition arises where d is only a and b or a and c. then aggregation should be used. Eg. $d = new a; if(condition) aggregate($d, 'b'); elseif(codition) aggregate($d, 'c'); $d->method(); That makes sence. But not doign this. $d = new a; aggregate($d, 'b'); aggregate($d, 'c'); $d->method(); I currently am trying to talk my company to use php over java. This is a huge project. The company i work for has 22000 employees and probally 500-1000 developers across us (mainly). And in desiging our classes i can see where i could use MI. and im not about to go and tell all 500 developers that evertime you create an instance of x you need to aggerate y. If aggregation is included then i see it is absoulty necessary to include MI too. - brad > > At 18:59 08/04/2002, brad lafountain wrote: > > >--- "Stig S. Bakken" <[EMAIL PROTECTED]> wrote: > > > On Mon, 2002-04-08 at 02:50, brad lafountain wrote: > > > > > > > > --- "Stig S. Bakken" <[EMAIL PROTECTED]> wrote: > > > > > On Sun, 2002-04-07 at 20:35, brad lafountain wrote: > > > > > > > > > > > > What would be wrong with having the *_SQL_* objects be a member > > of the > > > > > > *_Connection* classes? > > > > > > > > > > What you're describing here is object aggregation. > > > > > > > > What do you mean... Im saying that the SQL implementation is a member > or > > > the > > > > connection class.. Nothing to do with aggergation. aggergation would > mean > > > the > > > > methods of the sql imp would be apart of the connection class not a > > member. > > > > > > > > Im still not convinced that aggergation is usefull. > > > > > > Object aggregation in general is a technique where you have some > > > functionality in objects you forward calls to, a pretty common > > > technique. You can of course do that in PHP today, but it's slow (lots > > > of userland method calls) and high on maintenance (if an aggregated > > > class gets a new method, you must make a new wrapper in the forwarding > > > class, etc). In my opinion, providing "native" support for this in an > > > efficient way makes a lot of sense for PHP. > > > > Ok, Im still not convinced that I personally will ever use aggregation > > but im > >sure someone out there somewhere would want to use it. But my consern is > that > >people will start using aggregation instead of normal MI. Aggregation should > >only be used at certin times not just for MI. > > > >(as i said in another post) > > > > Basically I don't want aggergation to be the only way that a user can > > have MI > >just because MI isn't implemented. I can see users doing this. > > > >class A; > >class B; > >class C; > > > >$c = new C; > >aggergate($c, "A"); > >aggergate($c, "B"); > > > >Just because they "can". Not be cause it makes sence or its readable. I > guess > >it would aleviate my conserns if MI was included as well as aggergation. > > > >(as i said in another post) > > > > > >- 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 > __________________________________________________ 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