[Catalyst] CDBI Plain not inheriting table and columns
Jesse Sheidlower
jester at panix.com
Tue Aug 2 19:03:43 CEST 2005
On Tue, Aug 02, 2005 at 12:52:38PM -0400, Jonathan Manning wrote:
>
> As the other two replies suggested I could just not inherit from
> Catalyst::Model::CDBI::Plain, or use my classes directly. I don't see
> any downside to the first approach, and the second only skips
> autoloading of Model classes (so I'd have to use my modules manually in
> each controller). Is there anything that would be horribly missing if I
> ignored CDBI::Plain altogether?
There are a few other advantages to using them in Catalyst--you
can't forward() to non-Catalyst classes, for example.
> The second example in the POD just doesn't work as advertised. There's
> some sort of conflict between CDBI::Plain and normal CDBI modules.
> Perhaps the example should be removed unless it can be fixed, or it
> works for others. (But I haven't heard from anyone who is successfully
> using it in this way.)
The example does work for others, or it wouldn't be there.
However, the dirty little secret of CDBI::Plain is that it really
does nothing at all, as a glance at the source will show--it just
inherits from Catalyst::Base and that's really it. If you want, try
this:
package CatalystApp::M::Experiment;
use base qw/Catalyst::Base MyOther::Obj::Experiment/;
1;
and you _should_ get the functionality you seek without having
to worry about Plain.pm. Make sure your CatalystApp can see
MyOther::Obj::Experiment in its path of course.
Jesse Sheidlower
More information about the Catalyst
mailing list