Catalyst::Model::Proxy(U3s)er Contributed Perl DocumentatCiaotnalyst::Model::Proxy(3) NNAAMMEE Catalyst::Model::Proxy - Proxy Model Class SSYYNNOOPPSSIISS # a sample use with C # lib/MyApp/Model/DBI.pm package MyApp::Model::DBI; use base 'Catalyst::Model::DBI'; __PACKAGE__->config( dsn => 'dbi:Pg:dbname=myapp', password => '', user => 'postgres', options => { AutoCommit => 1 }, ); 1; # lib/MyApp/Model/Other.pm package MyApp::Model::Other; use base 'Catalyst::Model::Proxy'; __PACKAGE__->config( target_class => 'DBI' ); # get access to shared $dbh via proxy mechanism sub something { my $self = shift; my $dbh = $self->dbh; # ... do some stuff with $dbh } # back in the controller # lib/MyApp/Controller/Other.pm package MyApp::Controller::Other; use base 'Catalyst::Controller'; my $model = $c->model('Other'); $model->something; DDEESSCCRRIIPPTTIIOONN This is the Catalyst Model Class called "Catalyst::Model::Proxy" that implements Proxy Design Pattern. It enables you to make calls to target classes/subroutines via proxy mechanism. This means reduced memory footprint because any operations performed on the proxies are forwarded to the original complex ( target_class ) object. For more information on the proxy design pattern refer to: http://en.wikipedia.org/wiki/Proxy_design_pattern MMEETTHHOODDSS new Initializes DBI connection $self->target_class Returns the current target class for a proxy. SSEEEE AALLSSOO Catalyst AAUUTTHHOORR Alex Pavlovic, "alex.pavlovic@taskforce-1.com" CCOOPPYYRRIIGGHHTT This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2006-05-25 Catalyst::Model::Proxy(3)