In effect. I mean that if a method's interface is getting too complicated,
and particularly if it's getting to many parameters, that's usually a sign
that the method isn't on the right object.

Think of Java's String class, where you have simple methods such as
"matches" or "split" for basic regular expression operations, but if you
want to do anything fancy, you need to deal with the Pattern and Matcher
classes directly. The String methods are just one-liners. 

Anyone who needs all the functionality that's been mentioned can call
intention-revealing methods and provide procs to call. And call a method to
say whether or not they want a separate set of progress feedback for each
redirection or not. 

I know static checking isn't really Ruby's thing, but avoiding weirdness
like parameters that are hashtables full of uncheckable parameters has to be
a good thing! 

 -- elliott

-----Original Message-----
From: Tanaka Akira <akr / m17n.org>
To: ruby-core / ruby-lang.org <ruby-core / ruby-lang.org>
Sent: Sat Nov 15 15:27:31 2003
Subject: Re: open-uri patch, added progress_proc hook

In article <AD4480A509455343AEFACCC231BA850F17C354 / ukexchange>,
  Elliott Hughes <ehughes / bluearc.com> writes:

> This doesn't seem like a good API. There are just too many
> not-readily-distinguishable parameters. (I'm avoiding mention of type for
> obvious reasons. I don't want to be burned as a heretic.)
>
> Are we not missing an object? If we had an HttpOpener or whatever, it
could
> have named methods to let you set the various blocks. 
>
> We could keep the current convenience method, but implement it in terms of
> the new class. Anyone who needs the full configurability uses the class
> directly. So you get both simple interface *and* fully configurability. 

Do you mean that we need some layer between open-uri and net/http?
-- 
Tanaka Akira


*********************************************************************
This e-mail and any attachment is confidential. It may only be read, copied and used by the intended recipient(s). If you are not the intended recipient(s), you may not copy, use, distribute, forward, store or disclose this e-mail or any attachment. If you are not the intended recipient(s) or have otherwise received this e-mail in error, you should destroy it and any attachment and notify the sender by reply e-mail or send a message to sysadmin / bluearc.com
*********************************************************************