[Catalyst] Re: Reseting a chained action

A. Pagaltzis pagaltzis at gmx.de
Wed Aug 8 13:38:50 GMT 2007


* Pedro Melo <melo at simplicidade.org> [2007-08-07 11:20]:
> In the course of a project I'm working on, I found it useful to
> "reset" chained actions. It would work like this:
> 
>   . assume that you have a chain like /company/ID/copywrongs
>   . and in certain situations you want a alternative
>     environment for  the chain, like this:
>       /approve/company/ID/copywrongs
> 
> The /approve would modify the stash to include some alternative
> schema or environment that the rest of the chain could use to
> tweak their behavior. The thing is, the /approve action would
> like to tell  catalyst "ei, please disregard me and start
> over".

That doesn’t look very HTTPish. The URI should be purely the
address of a resource, whereas you seem to be putting an
operation in there. See also REST.

If you do in fact modify state on the server based on information
in the URI, I hope that you at least require POST for these
requests? Otherwise things like Google Web Accelerator or
Firefox’s prefetching will badly break your app, proxy caches may
cause heisenbugs, and all sorts of other mayhem.

(Anyone who is interested in hearing more about what I am saying
should run out and buy the book _RESTful Web Services_ by Leonard
Richardson.)

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list