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



_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to