in reply to Web presentation patterns, MVC, and reinventing the wheel
Then, you work some neat mechanism of registering the callbacks. They can even be the result of can (but you have to have an appropriate object to call it on) or method names (to be called on appropriate objects, presumably with can).my %callbacks = ( foo => \&do_foo, bar => \&do_bar, etc ... ); my $action = $cgi->param('action'); my $callback = $callbacks{$action}; die "No callback!\n" unless $callback; return $callback->(@args);
Of course, using CGI::Application is good cause it encapsulates the annoying work for you. :-)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|