On Tue, 27 Apr 2004 07:54:50 -0400, Kinyon, Rob wrote:
Hi Rob
> 1) You will want to do that kind of checking when you are handed the
> object in your constructor. So, you'll have to compile a list of
> methods
> the object will need to handle. Now, this is a good thing, from a
> documentation standpoint, but it's not what you suggested.
Yep. Cees suggested CGI provide a list of methods. I emailed Lincoln
Stein about this yesterday, but so far no response.
> 2) My CGI::Application children have a param() method (inherited
> from
> C::A). Now, if I provide a cookie() method (say, to handle my
> site-specific cookies), I now pass your interface requirements.
> But, I'm
> positive I won't be doing what you want.
There is, I hope, a mis-understanding here. Here's the situation:
#!/usr/bin/perl
use CGI::Simple;
use DBIx::Admin::Application;
DBIx::Admin::Application -> new(QUERY => CGI::Simple -> new() ) ->
run();
DBIx::Admin::Application is of course a CGI::Application-type class.
The ugly-named QUERY parameter is taking an object we hope can()
cookie and param.
I can't imagine why you would be passing an object of type
DBIx::Admin::Application to itself or to another object of the same
type, so the fact that objects of type DBIx::Admin::Application can()
cookie and param is just not relevant.
If some arbitrary class offers cookie and param, then yes, it is a
candidate for QUERY, but some logical errors are left as exercises for
the programmer to avoid :-).
> The -real- solution is not available until Perl6 when Roles are
> introduced into the language. At that point, you will be able to
> ask "if
> ($class does CGI)" and be done with it.
Sure, but I'd like a solution today, not in N years time, for some
hopefully small value of N :-).
--
Ron Savage, suppressed on 28/04/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav
---------------------------------------------------------------------
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.