Well, whether this is doable depends on what you wanted to do. But Perl does have multiple inheritance. You can choose to inherit directly from Apache::DBI and then directly from DBI. So you are a subclass of both, and if Apache::DBI isn't there things still have a chance to work. I say chance because if Apache::DBI and DBI do something differently enough, you might have to work around the difference.

Another approach is to reconsider doing any subclassing. What you want to do is preserve the interface, right? Well you can have an object that has an attribute which is the database handle it proxies through with an AUTOLOAD method. You can see an example of how to do that at Re (tilly) 1: Reverse Inheritance Irritance. And now you can wrap either one of them without having to do a lot of work...


In reply to Re (tilly) 3: Apache::DBI and DBI subclasses by tilly
in thread Apache::DBI and DBI subclasses by Hrunting

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.