[Catalyst] Question about Angerwhale Catalyst Application

Matt S Trout dbix-class at trout.me.uk
Mon Feb 12 09:47:43 GMT 2007


On 9 Feb 2007, at 19:52, Jonathan Rockway wrote:

> John Napiorkowski wrote:
>> I was under the impression that it you needed the
>> context in a component you needed to override
>> ACCEPT_CONTEXT, since new is only called once when the
>> application starts up.  Using ACCEPT_CONTEXT
>> transforms your component to a type Class, since it
>> creates a new object for each request instead of using
>> the same one over and over.  But maybe I am not
>> understanding it?
>>
>>
>> Appreciate some thoughts, just trying to improve my
>> best practices.
>
> I only need $c so I can get at $c->cache and $c->model('UserStore') at
> the beginning.  Also, that code was written before I knew about
> ACCEPT_CONTEXT -- Angerwhale was my first foray into Catalyst.   
> Despite
> that, it's proven extremely easy to maintain, extend, and refactor.

That's actually $app at new() time, not a request-level $c. Maybe if  
you renamed it it'd be less confusing?

-- 
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