Re: pearifying metabase: preparing phase 2
| From: | Stig S. Bakken | Date: | Tue, 05 Feb 2002 11:20:24 +0000 |
| Subject: | Re: pearifying metabase: preparing phase 2 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4528@lists.php.net to get a copy of this message | ||
On Tue, 2002-02-05 at 10:32, Bertrand Mansion wrote:
> le 4/02/02 23:18, Stig S. Bakken à ssb@alltheweb.com a écrit :
>
> > I don't think you need to worry about that now. I have a better
> > solution coming up in PHP 4.2: aggregate(). This is a new function that
> > lets you import methods from another class into an existing object.
> > This means we can simplify the architecture by having DB_connection and
> > DB_result objects importing backend-specific stuff on demand. This will
> > speed up simple calls a great deal (since there is less code to be
> > loaded always), and should reduce the result call overhead by
> > eleminating one layer of calls.
>
> Is that a php specific function or are there any other languages around
> using a similar function ? It is the first time I hear about such a feature.
> It can be very interesting.
Object aggregation is an established OO technique, you store references
to objects that provide functionality that you can't or don't want to
inherit. The difference here is that we short-circuit the technique by
making the methods and properties directly part of the aggregating
object's class (basically building and modifying a temporary class entry
for just that object). PEAR_Autoload implements "real" aggregation by
instantiating objects for the classes you want to make available this
way. But that is a lot slower than aggregate().
- Stig