On Sun, 2007-07-15 at 12:51 +0200, Roland Weber wrote:
> >> interface HttpParams
> >> interface ModifiableHttpParams
> >>
> > Do you still envisage the following way of setting HTTP parameters?
> >
> > httpclient.getParams().setParameter("whatever", someObject);
>
> Hm, no, not really. Should we encourage modifying parameters
> that are already passed to the framework in the first place?
>
> > or with the suggested change in place one would have to provide a whole
> > new instance of HttpParams in order to change a single parameter?
> >
> > BasicHttpParams params = new BasicHttpParams();
> > params.setParameter("whatever", someObject);
> > httpclient.setParams(params);
>
> No, no new instances. But a downcast will be needed.
>
> ((ModifiableHttpParams)client.getParams()).setParameter
> ("whatever", someObject);
>
> or if there is a helper:
>
> HttpClientParams.setParameter(
> ((ModifiableHttpParams)client.getParams(), someObject);
>
I tend to dislike downcasts. Besides, that implies every class that
implements HttpParams must also implement ModifiableHttpParams as well
to be of any use. So, what are we really gaining here?
Anyways, there are different ways of looking at things. So, I will not
object if you do it differently.
Oleg
> We can consider to include the downcast in the helper.
> I'd also prefer a shorter qualifier than "Modifiable",
> but RWHttpParams is inconsistent with our current naming
> schemes. And it looks ugly, too.
>
> cheers,
> Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]