[
https://issues.apache.org/jira/browse/HTTPCORE-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512809
]
Roland Weber commented on HTTPCORE-101:
---------------------------------------
[collection of thoughts]
There are few places in core, NIO, client et al where parameters are
instantiated within the framework and modified outside.
In most cases, it is possible to prepare parameters in advance and pass them to
a constructor.
This does not work for AbstractHttpMessage, there is no constructor that takes
a params argument.
Change examples to pass params to constructors, or to replace the existing
params instead of modifying them.
Create an additional singleton EmptyParams with an empty set of read-only
parameters, for AbstractHttpMessage and similar usage patterns.
interface HttpParams (ro)
+- interface ModifiableHttpParams
class AbstractHttpParams (ro) implements HttpParams
+- class AbstractModifiableHttpParams implements ModifiableHttpParams
+ class BasicHttpParams
Within the framework the parameters are used read-only, so the HttpParams
interface doesn't have to be replaced with the modifiable version.
> Consider read-only HttpParams
> -----------------------------
>
> Key: HTTPCORE-101
> URL: https://issues.apache.org/jira/browse/HTTPCORE-101
> Project: HttpComponents Core
> Issue Type: Improvement
> Components: HttpCore, HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Roland Weber
> Assignee: Roland Weber
> Priority: Minor
> Fix For: 4.0-alpha6
>
>
> Consider turning HttpParams into a read-only interface, moving modifiers to
> an extension interface.
> Suggested by Daniel Müller on httpcomponents-dev.
> This will break the following style of updating existing parameters:
> xxx.getParams().setParameter("name", value);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]