RE: [PEAR-DEV] MDB_Extended
| From: | Lukas Smith | Date: | Sat, 29 Nov 2003 20:23:01 +0000 |
| Subject: | RE: [PEAR-DEV] MDB_Extended | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-23978@lists.php.net to get a copy of this message | ||
> From: Matthias Nothhaft [mailto:php@mahono.de]
> Sent: Saturday, November 29, 2003 9:10 PM
> Hi Lukas Smith, you wrote:
> >>From: Matthias Nothhaft [mailto:php@mahono.de]
> >>Sent: Saturday, November 29, 2003 12:08 AM
>
> >>
> >>$ext = $mdb->loadModule("Extended");
> >>$ext->queryOne(...);
> >>
> >>Wouldn't this reduce code?
> >
> >
> > Well if I include the code all over the place in all modules then the
> > benefit is mostly lost. The point is to make the module truly optional.
> Isn't it truly optional yet?
> Why do you think that you would lose benefit?
>
> Is it too much overhead to call
> $ext = $mdb->loadModule(...)
> in each method where you use a module?
>
> Can you give me an example of your "I have to duplicate tons of code"?
The point is if I load the module all over the place I might as well leave
the code in the core to begin with.
> >>Maybe a abstract kind of iterator should be integrated to work with
> >>both, unbuffered and buffered lists in the same way?
> >
> >
> > Well if you use unbuffered queries you will just do query() and then
> > fetchRow() in a loop and then free the result set once you are done. You
> can
> > do this with buffered queries as well. But you might as well just have a
> > method query, fetch all data you want and free the result set, which is
> what
> > the query* methods do.
> Yes, I know this, but what is the certain problem?
> You have the queryXXX() and the getXXX() methods in "mod_Extended",
> so it is "truly optional", isn't it?
>
> Did you ever benchmarked 1.x against the core of 2.x?
>
> Is there a real performance gain in 2.x?
Well there is obviously a little gain if you don't use the module. There is
a performance loss if you do (which to me will be the case). There is the
benefit of having the API be a bit more "organized". So the question is
more:
Do you all think that you will be using the query*() (and get*()) methods
all the time or are there people that will actually not load the extended
module?
> > The point of the native class is that it doesnt do any abstraction. Any
> > similarities are "accidental". There is no emulation. If you use this
> class
> > you better know that you are only working with the correct backend.
> This is clear to me, but why does the native classes
> extend MDB_Native_Common?
>
> Where is this class? That was my question.
Ah ... now I get it ... the way things are now is a mistake.
I will probably remove the "extens".
Regards,
Lukas