Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Catalyst - components from other namespace

by stonecolddevin (Vicar)
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.

mtfnpy


Comment on Re: Catalyst - components from other namespace
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.

      mtfnpy

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://893818]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-04-20 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls