[Catalyst] How do I make my class dbi Model classes a subclass of another custom class ?

Anthony Lee anthony.lee at uk.tiscali.com
Mon May 2 15:56:49 CEST 2005

Sorry if this email is a bit vague, however I am currently learning to use Catalyst.

I would like to inherit a number of my classdbi model classes from a base class:
I have created a new directory under my package NIM, in a new subdirectory called Base

In my model classs: NIM::M::CDBI::Llulinterface:-

package NIM::M::CDBI::Llulinterface;

use strict;
use base NIM::Base::M::L;

=head1 NAME

NIM::M::CDBI::Llulinterface - CDBI Model Component Table Class

###end of snipet
In NIM::Base::M::L.pm ( a simple class)
mk-solaris3-dev# more NIM/Base/M/L.pm
package NIM::Base::M::L;

sub atest {
    print "Inheritated call";

However When I run my package:

perl -e 'use NIM', It seems that inheritance does work, and I can call the method NIM::M::CDBI::Llulinterface->atest 
except I get a warning like this:-

mk-solaris3-dev# perl -e 'use NIM'
[Mon May  2 13:50:41 2005] [catalyst] [debug] Debug messages enabled
[Mon May  2 13:50:42 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI"
[Mon May  2 13:50:45 2005] [catalyst] [debug] Loaded tables "btinport btoutport chassis chassiscard component componentstatus datainport dataoutport exchange ftiepair growthtree growthtype lineinterface llufblock llufinterface llufp llulblock llulinterface llutblock llutinterface ltiepair man model modelconstraint querycache rack ttiepair"
Couldn't require "NIM::M::CDBI::Llulinterface", "Unknown error
Compilation failed in require" at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 739
[Mon May  2 13:50:46 2005] [catalyst] [debug] Initialized components "NIM::M::CDBI::Llulblock NIM::M::CDBI::Rack NIM::M::CDBI::Ltiepair NIM::M::CDBI::Btoutport NIM::C::netprovisioning NIM::M::CDBI::Llulinterface NIM::M::CDBI::Datainport NIM::M::CDBI::Dataoutport NIM::V::TT NIM::M::CDBI::Growthtree NIM::M::CDBI::Growthtype NIM::M::CDBI::Chassiscard NIM::M::CDBI::Btinport NIM::M::CDBI::Componentstatus NIM::M::CDBI::Llufinterface NIM::M::CDBI::Llufblock NIM::M::CDBI::Chassis NIM::M::CDBI::Model NIM::M::CDBI::Component NIM::M::CDBI::Ttiepair NIM::C::mycontroller NIM::M::CDBI::Man NIM::M::CDBI::Querycache NIM::M::CDBI::Modelconstraint NIM::M::CDBI NIM::M::CDBI::Llufp NIM::M::CDBI::Ftiepair NIM::C::btactions NIM::C::Growth NIM::M::CDBI::Lineinterface NIM::M::CDBI::Llutblock NIM::M::CDBI::Exchange NIM::M::CDBI::Llutinterface"
[Mon May  2 13:50:46 2005] [catalyst] [info] NIM powered by Catalyst 4.34
[Mon May  2 13:50:46 2005] [catalyst] [debug] "NIM" defined "!default" as "CODE(0x41a70c)"
[Mon May  2 13:50:46 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI"

However If I simply require the package, (using a require statement this seems to work without error). Is this something to do with the Module::Pluggable::Fast modules used in catalyst ?? Is this the correct way to build base classes for my classdbi classes ??

Also, is there anyway I can turn off the Class::DBI::Loader. I am using an Oracle database, and startup times for my package seems significantly slower, then if I simply defined the columns/relationships of each on my tables within the Model classes. I guess the Class::DBI::Loader is performing a select * from user_constraints, user_cons_columns. I will be using FCGI for all the parts of the application which have a web interface, but I was hoping to reuse the Model/Controller part to create a backend API interface to the application (which may not be running as a persistent application)

Any help on any of the points would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/6ed415bb/attachment.html

More information about the Catalyst mailing list