On Wed, Aug 09, 2000 at 11:41:20AM +0100, Hildo Biersma wrote:
> Philip Newton wrote:
> > 
> > On Wed, 9 Aug 2000, Hildo Biersma wrote:
> > 
> > > Persoanlly, I think both CGI.pm and File::Spec should be OO modules.
> > 
> > And I think CGI.pm should be procedural module :-). (I have no experience
> > with File::Spec, so can't comment on it.) I think OO is sometimes
> > overdone. I don't always want to have to instantiate an object just to
> > call a method when it's not obvious why this method couldn't just be a
> > normal subroutine.
> > 
> > > Having said that, I would not mind CGI.pm being a procedural front-end
> > > to an CGI::Object module - I'd just use the latter.
> > 
> > And I would use the former. And ISTR a rumour that said that Lincoln Stein
> > prefers or recommends the procedural method, even though the docs use OO
> > examples.
> 
> Could we agree on the idea that CGI.pm should be split up?

Why not write an RFC to that effect, but don't limit it to CGI. Include
any other modules which provide a dual interface.

Personally I would not mind allowing

$cgi = CGI->new

which actually returned a CGI::Object. Of course CGI::new would have
to check that the first arg was 'CGI' and croak otherwise as this would
indicate an @ISA set to CGI instead of CGI::Object. ie

sub new {
  my $pkg = shift;

  croak "Bad inheritance of CGI via $pkg"
    unless $pkg eq 'CGI';

  require CGI::Object;

  CGI::Object->new(@_);
}

Graham.

Reply via email to