[Catalyst] reference lib outside Catalyst web applicationdirectory
Matt S Trout
dbix-class at trout.me.uk
Wed Dec 13 19:10:00 GMT 2006
On 13 Dec 2006, at 14:59, Dave Howorth wrote:
> Matt S Trout wrote:
>> I'm asking why the web part can't be in the main app directory :)
>
> I've been reading this thread with interest because Leandro's
> description seems to fit my situation as well. This seems like a
> pretty
> lame response. Does it mean that Catalyst can't be configured to
> live in
> a separate place from the bulk of the 'business' logic?
Yes it does, it's impossible to write an application that depends on
external code - that's why you can't use CPAN libraries with Catalyst
...
no, wait, you can :)
> The ability to put different bits of an application suite in different
> places is a pretty useful capability for application designers.
And if you want to do that, you can happily have a MyApp-Base
distribution, a MyApp-Web distribution, etc.
Just make them normal perl dists with appropriate dependencies.
catalyst.pl creates you a valid CPAN dist which makes it trivial to
do that for the web part - anything else should be done the same way.
>
> The ability to separate concerns is a fundamental strategy in software
> engineering.
>
> Or am I misunderstanding?
I think you and Leandro are both trying to do something the hard way.
If it lives as part of the main dist, put it in lib/ like normal.
If it wants to be separate, make it a separate dist that depends on
the common stuff.
Screwing around with @INC when you can just write stuff that can be
'make install'ed is the only thing here I'd call lame :)
--
Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for
Catalyst,
DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for
details.
+ Help us build a better perl ORM: http://dbix-
class.shadowcatsystems.co.uk/ +
More information about the Catalyst
mailing list