> Another solution is to just reuse the teardown method, and be sure to
call
> $self->SUPER::teardown within any teardown method you create. This
will walk up
> the inheritance tree and execute the teardown method of the
superclass.
I thought about doing this but then it puts the onus of remembering to
call SUPER::teardown on the subclassor. The idea behind what I'm working
on is to make a more extensible drop in replacement for
CGI::Application. I may subclass this module 6 months from now or it may
get published to CPAN and then every one that uses it has to remember to
SUPER::teardown
Tony -
Standard Perl OO methodologies require that if you are adding to
the parent's behavior, you have the responsibility to make sure that the
parent's behavior is called. You can call it before, during, and/or
after your addition to the behavior.
This is a good design because this allows the child, who's the
one in control, to determine if they want to add onto the parent's
behavior, and when, or if they want to replace the parent's behavior.
Personally, I think everyone should always call SUPER::whatever.
In my setup() in my application baseclass, I still end with "return
$self->SUPER::setup();", just in case some version of C::A I upgrade to
adds useful behavior in its setup() (instead of just setup { 1; } as it
is now). It makes you more flexible in the future.
Rob
CONFIDENTIALITY NOTICE: The information in this electronic transmission and any
documents accompanying it may contain confidential information belonging to the
sender, which is legally privileged. The information is intended only for the use of
the individual or entities named above. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution or the taking of any
action in reliance on the contents of this information is strictly prohibited. If you
have received this transmission in error, please destroy the message in its entirety.
---------------------------------------------------------------------
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]