On 9/23/05, Tim Bunce <[EMAIL PROTECTED]> wrote: > I'm interested to hear stories of people who have subclassed the DBI, > or used modules that subclass the DBI.
I have subclassed DBI to: - have a central user/password location - force checking of DBI method return values - integrate DBI error reporting with standard practice at my site - force handle caching - add some functionality (create a new method like do that does the right thing) > Was subclassing the DBI a good approach? Indeed. > Where there any problems? Once you figure out that you have to subclass three packages (DBI, DBI::db, DBI::st) instead of just one, no. > Could it have been done well/better some other way? This was done a while ago and I think it has improved since I did it. The real trick would be to make it better while still trying to make it look like what someone would expect. That is, somehow making subclassing DBI, which is a complicated module, look like subclassing a simple module: use base DBI; As usual, the DBI documentation is good on this subject. dd -- David Dooling