At 08:01 AM 11/9/2001, Perrin Harkins wrote:
> > > I don't have any specific complaints about libservlet.
> > > I'd probably prefer to see Perl-style method names
> > > (get_foo(), not getFoo()) and named parameters
> > > (get_foo(bar => \$baz)), but these are small things.  I
> > > think doGet()/doPost() are kind of silly too, and maybe
> > > should be dropped in favor of service().
> >
> > silly in what way? do you think that every servlet that's
> > written should have to implement its own delegation scheme
> > for http method handlers? or do you have another idea?
>
>I meant that most apps don't care whether they were called with GET or POST,
>and those that support special methods often want to do custom delegation
>anyway.  I've never wished for separate methods in mod_perl handlers for GET
>and POST.
>
>Bruce Eckel agrees with me in "Thinking in Java", but he's going against
>common wisdom in the servlet world.  What I usually see suggested is to have
>your doGet() method call doPost(), or have both call some other private
>method.  And that's the part that seems silly - delegating the request to
>one of two methods that both go to the same place.

I remember attending a talk by Bruce Eckel saying that he never could learn 
Perl. He said he tried very hard but found the language to be too difficult 
to learn compared to Java which seemed clean and simple to him.

I don't know what this really has to do with the argument other than that 
Bruce Eckel thinks some hard things are easy and thinks some easy things 
are hard. So although it is useful to take in what he says, I am not sure 
he is always right.

In this case I do agree. I frequently see people (and I myself do it) just 
make doGet and doPost into the same thing. When I am debugging web app 
code, I make the <FORM> tag into a GET so I an see the params on the URL 
easily, and then switch back to POST when I am done. But if I had to change 
the servlet code to switch between interpreting gets and posts, my life 
would be a lot more annoying.



Reply via email to