in reply to Mapping URLs to code - in search of perlish dispatch schemes

Catalyst has a module Catalyst::Plugin::AutoSession which automatically puts request parameters into session variables. It looks to me that this technique could be the beginning of your parameter mapping scheme. The URL mapping scheme exists already in Catalyst: you can perhaps write your parameter mapping scheme into a Catalyst::Plugin and make a helper-script which can translate your declarative language into a Catalyst application.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Mapping URLs to code - in search of perlish dispatch schemes

Replies are listed 'Best First'.
Re^2: Mapping URLs to code - in search of perlish dispatch schemes
by Corion (Patriarch) on Jul 20, 2006 at 21:18 UTC

    Hmmm - I'm not sure I understand what Catalyst::Plugin::AutoSession does - it seems to be geared at extracting exactly one parameter out of the URL. I'm looking more in the direction of a mini language that I can use to dispatch any URL to the most-fitting code. I'm not looking for a framework-specific solution because I haven't found a framework that I like.

    Of course, any URL-specification must be translated into something that the backend framework can understand, but firstly, I'm looking at what possibilities the frameworks offer to declare my wishes.

      The module gets all parameter values, whether they are in the URL ("GET") or through forms ("POST") and automatically put them in the session (whatever the backend-storage for the session is).

      Of course you would just "catch" the parameters and check them against your requirements in the declarative language.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law