[Dbix-class] DBIC::Loader + M::Pluggable
Brandon Black
blblack at gmail.com
Tue Jan 24 17:03:01 CET 2006
On 1/24/06, Daisuke Murase <typester at cpan.org> wrote:
> Hi.
>
> I want to Module::Pluggable feature into DBIC::Loader, and here is an
> suggestion and sample code.
>
>
> package DBIx::Class::Loader::Pluggable;
> use strict;
>
> use base qw/DBIx::Class::Loader/;
> require Module::Pluggable::Fast;
>
> sub new {
> my $class = shift;
> my %attr = @_;
>
> my $self = $class->SUPER::new(@_);
>
> Module::Pluggable::Fast->import(
> name => '_components',
> require => 1,
> search => [ $attr{namespace} ],
> );
> __PACKAGE__->_components;
>
> $self;
> }
>
> 1;
>
>
> I think this module are usable, especially using Catalyst Model from
> outside script. example:
>
> DBIx::Class::Loader::Pluggable->new(
> dsn => 'dbi:...',
> namespace => 'MyApp::Model::DBIC',
> );
>
> That's it. MyApp::Model::DBIC::* was already loaded, and ready to use.
>
>
> I hope this feature were merged into Loader.
>
> If not, I think uploading to CPAN as a separated module.
> (then I should probably rename it)
>
> How about this ?
>
DBIx::Class::Loader is going to become deprecated soon. It will be
replaced by DBIx::Class::Schema::Loader, which requires DBIx::Class
0.5+. So if you're considering any major work, either wait for that
transition to be finished, or take a look at the current progress @
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class-Schema-Loader.
I don't quite understand what it is you're trying to do with
Module::Pluggable::Fast above - could you explain with more detail
what it would accomplish?
-- Brandon
More information about the Dbix-class
mailing list