Re: MDB_Extended

From: Date: Sat, 29 Nov 2003 20:09:39 +0000
Subject: Re: MDB_Extended
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23977@lists.php.net to get a copy of this message
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"?
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?
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.
And finally: A "little" feature request for LOBs: Maybe it would be usefull to have a factory for reading and writing LOBs for example to/from files, FTP, Streams, and other stuff!?
Well there is such a factory! It's the "createLob" method. However in MDB 2.x you don't need to touch it if you don't want to. You just have to pass an array to the setParam method before the insert and it creates the LOB object for you. When you fetch a LOB you just need to tell MDB which column contain LOBs and it will create the necessary instance for you. Right now you can read/write from and to variables and files. If you want more you can add new classes to the LOB.php module. Oops, ok, I'll check this once more!
Regards, Lukas Thanks for your answer.
Regards, Matthias

« previous php.pear.dev (#23977) next »