[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Re: critical bug in 'import' of CGI::App 3.21 (test case available)


On Thu, Feb 12, 2004 at 04:24:12PM +0000, Steve Hay wrote:
> The only issue being created that doesn't already exist which I can 
> think of is the one that I alluded to with my patch, namely where people 
> inherit from three or more classes.  They could code a Foo class such 
> that @ISA = qw(CGI::Application Foo Exporter) will work under C::A 3.1 
> (i.e. Foo's import() calls Exporter's), but now, because of C::A 
> introducing an import() routine, that would break.
> 
> Perhaps an "Incompatible Changes" section should be introduced into the 
> README or POD documentation describing this possible scenario.

I happened to have left off reading Damian's _Object Oriented Perl_ at
just this section. If anyone has the book, they may want to read through
section 6.2.4 - The SUPER pseudo-package (p. 183-184).

Besides being a good description of the problem at hand, it discusses a
solution for calling all of the import() methods in all of the inherited
classes. I'm not familiar with using Exporter (as I do not use it
regularly) so this solution may not be at all desirable.

Perhaps using SUPER instead of short-circuiting the inheritance tree
would be a solution to the above problem that Steve described. If Foo
did not have an import() function, wouldn't it get passed up to
Exporter? Perhaps Steve's code could be modified to the following:

  goto SUPER::import if $class->isa('Exporter');

It seems to me that this multiple-inheritance problem goes to show why
Sam is not keen on using the mix-in pattern for adding new functionality
to C::A (ala C::A::ValidateRM and C::A::Session). Am I following these
issues correctly (I'm new to the whole multiple-inheritance model
myself)?


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.