On 9/26/05 5:01 AM, Tim Bunce wrote:
> Anyone else have a DBI subclassing story to tell?

My story is short: I never seriously attempted it because I knew how scary
and non-standard DBI was internally.  Several times in my misspent youth I
wanted to do something "simple" like:

    package MyDBI;
    use DBI;
    our @ISA = qw(DBI);
    sub connect
    {
      my $class = shift;
      ...; 
      $class->SUPER::connect(...);
    }

but, of course, that doesn't quite work out.  I think the best argument for
subclassing DBI is that people (initially) expect it to work, so it should.
There's no sense in trying to predict why people will want to subclass.
Just make sure it's straightforward, and let the actual instances of
subclassing bloom... :)

-John


Reply via email to