[Catalyst] Re: Subsessions?

Matt S Trout dbix-class at trout.me.uk
Wed Oct 3 22:54:48 GMT 2007

On Wed, Oct 03, 2007 at 11:10:50AM +0200, Rainer Clasen wrote:
> Matt S Trout wrote:
> > On Sun, Sep 30, 2007 at 11:25:31AM +0200, Rainer Clasen wrote:
> > > A. Pagaltzis wrote:
> > > > You???re asking the wrong question. Sessions are a bad idea in
> > > > general; application state should live on the client, not the
> > > > server. All state on the server should be resource state, ie it
> > > > should have a URI of its own.
> > > 
> > > I also consider "normal" sessions evil. My subsessions are still ugly, but
> > > at least they keep the state control in the client.
> > > 
> > > The subsessions were my answer, when I failed to setup the Chained
> > > Dispatcher according to my laziness.
> > 
> > So you failed to make a basic feature of Catalyst work.
> well no. I looked at the Chained stuff and was distracted. 
> With the input from the list I've ditched the Subsessions and went for
> Chained because it seems to be the "RightThing" - although Subsessions are
> a quite comfortable solution: Once setup, they're available everywhere
> within the application, no need to worry anymore. 
> That's quite the opposite of Chained. Nearly all URIs in this project look
> like /<athlete>/diary/list or /<athlete>/exercise/add. This means all
> actions have to be setup for chaining manually, CaptureArgs have to be
> verified on each request, uri_for becomes a hassle to use and last but not
> least the chance to break the natural URI to Controller namespace mapping
> is quite likely.

Not sure I understand "setup for chaining manually".

CaptureArgs you verify further up your chain, in a common method that just
handles the <athlete> bit.

uri_for($action_object, \@captures, @args

continues to work perfectly (it supports regex as well, even)

      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

More information about the Catalyst mailing list