[Maypole] Maypole model inheritance

Simon Flack sf@flacks.net
Sun, 12 Dec 2004 17:43:55 +0000


Dave Howorth wrote:
> 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> 

Yes, I like that. One issue is that the table2class() differs from 
Class::DBI::Loader. E.g.

table: hello-world
CDBI::AutoLoader: HelloWorld
CDBI::Loader: Hello-world    # this is an invalid package name

table: hello__world
CDBI::AutoLoader: HelloWorld
CDBI::Loader: Hello_World

I'll look into this further.

Simon