On 2004-01-21, Terrence Brannon <[EMAIL PROTECTED]> wrote:Cees Hek wrote:
What if someone wants to create a CGI::Application::Session module based on Apache::Session?
Someone has:
http://perlmonks.org/index.pl?node_id=142050
Thanks for the reference. I definitely don't like rob_au's implementation as well. He has created a new "super class" which would need to be inherited from. If you have your own cgiapp_init, you have to a do little jig to make sure they are both called appropriately. Having a new method named "session" is much more intuitive.
That was my thought as well :)
As for your comment on the cgiapp_init issue. I have been thinking about that in the last couple of days. It is sometimes annoying to have to do that little jig to get something done at cgiapp_init time in two places in the code (ie perhaps in your super class, and in your runmode module, and now also possibly in a third party glue module).
I think a nice addition to CGI::Application would be a system where you can register multiple functions at the different stages of execution in CGI::App.
So instead of doing the following:
sub cgiapp_prerun {
my $self = shift;
# do some stuff
}You could do:
$self->cgiapp_register(prerun => sub {
my $self = shift;
# do some stuff
}- or -
My::Class->cgiapp_register(prerun => sub {
my $self = shift;
# do some stuff
}This would allow your base class to execute some code at the cgiapp_prerun hook, without blocking your runmode modules from using that hook as well.
Cees
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
