|
You might want to take a look at MooseX::NonMoose to help with this. Moose does it's best to extend non-Moose classes, but with the 100 different ways to create objects in Perl OO it cannot always do the right thing. MooseX::NonMoose aims to actually fill the gap where core Moose fails.
For your particular case, I would actually recommend delegation and not inheritance simply because DBI is a very complex module that internally uses things like tie() and XS so may very likely not play well with Moose subclassing. Not to mention that DBI is just a "factory" for DBI::db instances, which then in turn creates DBI::sth instances, and so simple subclassing of DBI is actually not very simple.
You also might want to join the moose mailing list (moose@perl.org) or visit IRC #moose@irc.perl.org and ask this question there. I am pretty much the only Moose person who subscribes to these updates. If you ask there you will likely get much more help and insight.
- Stevan |