Hello all, After the recent discussion about improving C::A::Dispatch I've put together an initial version. It's not complete, but it's definitely working. If you want to help out, it's being hosted in Jason Crome's svn repo:
svn://svn.cromedome.net/CGI-Application-Dispatch Read access should be public and if you want to help out (it will get done much sooner if there's some help), I'm sure he'll give you write access if you ask. DONE: + New version of the dispatch table + options are lowercase + initial tests + mostly backwards compatible (see below in TODO) + setting $CGI::Application::Dispatch::DEBUG to true will give a nice trace of what rules where attempted and which one finally matched. TODO: + The plugin part (C::A::Plugin::Dispatch) to provide URL creation functions to the application. I've been thinking that since we're creating the application object we could find a way to have it automatically 'use' the plugin so that application author's wouldn't have to think about it. If they use Dispatch, then their application would automatically have these methods. + Documentation. I removed a lot of the old stuff since it wasn't relevant, or deprecated. I've rearranged some stuff, but there's still a lot lacking. Especially for the new dispatch table and a rewrite of the 'PATH_INFO Parsing' is probably due as well. + Backwards compatability. There are currently some features of Dispatch that don't work in the new version, but I'm not sure how big of an issue this is. It really depends on how people are currently using it. Here are some things that don't work, so if you care about these features, let me know: + $self->param('CGIAPP_DISPATCH_PATH') does not currently work. I suspect it will be replaced by something much better in the Plugin part. + overloading get_module_name() and get_runmode() in a child class won't really work since those methods don't exist anymore. The retrieval of the run mode and module name are tied to the new dispatch table. But since the dispatch table is much more flexible, I'm not sure this really matters either (there is a new translate_module_name() method for that performs the 'module_name' => 'Module::Name' translation that you can override however. + the 'RM' option. If you don't want Dispatch to choose the run mode, don't put it in your table. I'm flexible on these compatability issues and can add them back if there is a real need. But I'd prefer to drop them since they are now irrelevant and will just complicate the code. Thoughts? -- Michael Peters Developer Plus Three, LP --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]