--- Kristian Köhntopp <[EMAIL PROTECTED]> wrote: > brad lafountain wrote: > > Unless someone could give me a real reason that > > aggerate is better than MI. > > Aggregation does at runtime what MI does at compile time. > Delaying the decision to "do" something is usually an enable for > specific applications. > > Examples are the signal/slot mechanism based call-models in > Gnome and Qt vs. virtual function tables in C++. The decision > which implementation for a method is being called is delayed to > the actual point in time when a call is being made, enabling a > much more flexible component model and much better reuse.
Im not familure with this can you please explain. > > The cost for doing things late is worse typechecking, errors are > potentially caught only at call-time, not at compile-time (with > Qt, it probably is link-time, due to the way it is implemented). > > The same goes with aggregation. Aggregation allows me to write a > class "Soaping", which implements a SOAP RPC Client and a > SOAPFactory class, which manufactures objects of any class and > aggregates Soaping into them: > > I could include_once() any unknown class, create an instance > and use PHPs introspective functions to create a list of > functions and instance variables in this class. By adding > Soaping functionality to the class, and with the help of > getters, setters and wrappers provided by overload(), I > can intercept all accesses to this instance, turn them into > SOAP calls to some remote instance of that object, and > marshall the results back into my application. > > The beauty of this is, that I can do this at run-time, and that I > can do this generically with any old class, using two miniscule > additions to the system, aggregate() and overload(). Yet for the > user this is probably transparent. I have made this exact soap client and server as a php extension. It works fine without aggregation. > > > Class definition is defined at design time not run time! > > No, it isn't. Unless you are stuck with C++. > > PHP is for rapid prototyping. That may turn into rabid > prototyping (SCNR the pun) if you do not know how to use it, but > it may also be an extremely powerful tool as I have shown. > > Generally speaking, it allows you to design metaclasses and > metasystems, which add some general function to the language > itself. > I guess my biggest argument is that aggergration will cause some problems like serizliation and Im still not convinced that aggergration does any good when you are designing a class libary. 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. - 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