Re: [Maypole] Maypole model inheritance

From: Dave Howorth (Dave.Howorth at acm.org)
Date: Sun Dec 12 2004 - 16:10:16 GMT


Dave Howorth wrote:
> The difficulty here is that it's C-DBI-Loader that makes
> MyApp::Model::Table inherit directly from Class::DBI::$driver. So to
> make this work, you have to rewrite C-DBI-Loader, I think? Which seems
> odd, since the scenario (using C-DBI-Loader to set up the table classes
> but also wanting to use other C-DBI-* modules) is pure C-DBI, no
> Maypole, so there ought to be an existing solution out there somewhere.

I did a little browsing around CDBI and found what may be a possibility.
I looked at AutoLoader
<http://search.cpan.org/~ryanparr/Class-DBI-AutoLoader-0.12/AutoLoader.pm>
to see what it did and discovered two interesting features:

(1) It has a specific mechanism for loading additional classes:

  use Class::DBI::AutoLoader (
         ...
         additional_packages => ['Class::DBI::AbstractSearch']
  );

(2) It has a method of playing base class switcheroo using this package
specifically designed for the purpose:

<http://search.cpan.org/~rclamp/Class-DBI-BaseDSN-1.22/lib/Class/DBI/BaseDSN.pm>

Food for thought.

Cheers, Dave

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT