[Catalyst] Mason view hackers (and other views), PING

Marc Espie espie at nerim.net
Sun May 13 15:40:30 GMT 2007


On Sat, May 12, 2007 at 02:09:31PM -0500, Dave Rolsky wrote:
> On Sat, 12 May 2007, Matt S Trout wrote:
> 
> >Something I'd be delighted if you'd have a think about: how to make Mason
> >use intelligent search paths for Chained actions - the autohandler/dhandler
> >etc. system is beautiful but it'll need a smart mapping from the cat 
> >actions
> >onto the mason paths to really make it go for Cat users.
> 
> I'm not sure I follow.
> 
> In my opinion, the dhandler portion of Mason is entirely superfluous when 
> using Catalyst. Catalyst already provides many dispatch options to do 
> similar things, including default() methods in your controller, which act 
> more or less exactly like dhandlers. I always kind of assumed default() 
> and auto() had been inspired by Mason, because they work so much like 
> Mason does.
> 
> The autohandler stuff is still really useful, but I just use it for 
> wrapping header/footers or path-specific menus around the called 
> component.
> 
> I guess my take on it is that you do the dispatching part in your 
> controller, and as part of that, you should also decide what component to 
> call for the view. The default for this in the Mason view seems to be the 
> same as that in the TT2 view, which is to use $c->req->match. That seems 
> reasonable to me.

This ties in directly to the question I asked a week ago: I have a Mason
app, I'd like to migrate it to Catalyst, but slowly. This is some kind of
`inside-out' thinking... I haven't really had time to make progress on
this one (busy refactoring a completely different perl 
projet -- OpenBSD's pkg tools), but in my case, I have some Mason stuff,
already complete with autohandlers, and I'd like to be able to have mason
`components' be catalyst invocations (including as subpart of pages) and
slowly migrate to a full catalyst.

I can rewrite the app as a catalyst app, and have a `flag day' where I
redeploy everything and forget the old app... but this is going to take
time. I would rather proceed bit by bit, and to this end, being able to
use more Mason-style organization from the catalyst side would be some
useful migration tool....



More information about the Catalyst mailing list