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.

For now, consider Angerwhale a "get 'er done" thing, not a Catalyst
best-practices guide.  There's lots of awesome messy code in there.
(See all the default actions, for example.)

Fixes welcome -- mail me if you want a svn account.

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

_______________________________________________
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