On Fri, Sep 23, 2005 at 11:19:19PM +0100, Tim Bunce wrote: : I'm interested to hear stories of people who have subclassed the DBI, : or used modules that subclass the DBI.
We usually subclass the DBI in our code to abstract out things like user authentication, server locations, etc. We can load that stuff from a config file or internal constants in the module and just request the proper handle from our code. Sometimes, we add in ancillary methods to do common SQL operations more easily. : Was subclassing the DBI a good approach? It's a great approach. : Where there any problems? Our only "problems" arise when we're using the DBI with Apache::DBI. Then, our subclassing package has to be aware of whether or not Apache::DBI is loaded and subclass itself into Apache::DBI (this may be resolved in newer versions of DBI) instead. : Could it have been done well/better some other way? I'm pretty happy with the way it is now. It's pretty simple and easy to use. I remember with earlier versions it was pretty rough, but a couple of years ago changes were made that made it much simpler. * Philip Molter * Data Foundry * http://www.datafoundry.com/ * [EMAIL PROTECTED]