Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Catalyst - components from other namespace

by stonecolddevin (Parson)
on Mar 17, 2011 at 17:43 UTC ( #893818=note: print w/replies, xml ) Need Help??

in reply to Catalyst - components from other namespace

CatalystX::InjectComponent allows you to inject arbitrary classes into your app, but I have to ask what you're trying to achieve by this? If you want to use a, say, Moose class, as a model for instance, you can use Catalyst::Model::Adaptor.


  • Comment on Re: Catalyst - components from other namespace

Replies are listed 'Best First'.
Re^2: Catalyst - components from other namespace
by roman (Monk) on Mar 17, 2011 at 19:28 UTC

    It seems that CatalystX::InjectComponent does what I need.

    I have two applications sharing quite a lot of codebase (they are actually two interfaces to one backend). They have many common actions, they use same DBIx::Class::Model, they both render their output via Mason with same configuration.

    Of course I could create OurApp::Controller::* and inherited it by MyApp::Controller::* and YourApp::Controller::*, but it just triples the number of files.

      In that case I'd work on putting together an API layer over the backend and having the web apps just be layers on top of THAT that use those API calls as opposed to injecting this with that and such. It will give you a tremendously more flexible application structure.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://893818]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2018-06-24 22:47 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.