Tim Bunce wrote:

I just called for suggestions, proposals, and random thoughts.
It's my job to mix those in with my own random thoughts and
try to distill something reasonably coherent and Practical.

Then we'll go round the loop a few (dozen) times kicking the tires
and mixing metaphors till enough people are happy enough.
(I get the casting vote on behalf of the silent majority :)

Just two ideas from one of the usually silent majority:

First: There should be a *simple* way for a DBD to inherit from another DBD. From what I've learned the last two weeks about the internals of the DBI, this is currently done in a way that is quite different from the way the remainder of Perl does it. I would like to be able to do the following:

   package DBD::MyBadlyHackedODBC;
use base 'DBD::ODBC'; # <--- ordinary Perl inheritance without any DBI "magic"
   sub someMethodInODBC
   {
       my $self=shift;
       $self->SUPER::someMethodInODBC(reverse @_)
   }
   1;

   my $dbh=DBI->connect('dbi:MyBadlyHackedODBC',...);

This would allow me to change the behaviour of a DBD for my needs without having to dig through kilobytes of C and XS code.

DBDs are currently four classes, making this kind of inheritance a little bit harder, because my hacked DBD would have to inherit the base, ::dr, ::db and ::st classes. Perhaps a tiny pragmatic module could help: use DBI::base 'DBD::ODBC' (instead of use base 'DBD::ODBC') would create the four classes for my hacked DBD, all inheriting from their corresponding classes. So my code would look like this:

   package DBD::MyBadlyHackedODBC;
   use DBI::base 'DBD::ODBC';
   package DBD::MyBadlyHackedODBC::db;
   sub prepare
   {
       my ($dbh, $statement, $attribs)[EMAIL PROTECTED];
       $dbh->SUPER::prepare(reverse $statement,$attribs)
   }
   1;


Second: $h->func(@func_arguments, $func_name) is ugly. The $func_name argument should really be the first argument, not the last. DBD::Foo::db->install_method($method_name, \%attr); is a step into the right direction, but the driver-specific methods should be available for use right after DBI->connect(), without having to "import" them manually. The driver-specific prefix is a good thing, it clearly indicates non-portable code: If I write $dbh->pg_polish_harddisk('now','shiny'), why should I have to call DBD::Pg::db->install_method('pg_polish_harddisk') first?


Alexander Please inform us immediately if this e-mail and/or any attachment was transmitted incompletely or was not intelligible.
___________________________________________________________________________

This e-mail and any attachment is for authorized use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.

Reply via email to