Ortwin Gl�ck wrote:

>
> Proposoal No 1
> Store preferences in Properties objects. Do not use System properties.

Definitely, this is the major reason I DON'T use the default 
URL/URLConnection that Sun provides, why would anyone want to have 
properties such as proxyHost and proxyPort stuck into the System 
properties. Nothing sucks more than wanting to setup two or more http 
connections that have different proxies in this case. How do you do it? 
You can't if its configured in the static System.properties.

>
>   HTTP offers a large number of features. And HttpClient is used by 
> groups of users with different (often opposed) interests. So the 
> number of configuration parameters is potentially large and will most 
> probably grow as HttpClient evolves and gains popularity.
>
> It is therefore unwise to add one pair (get/set) of methods for every 
> new config parameter. A more general solution is needed.
>
> The Java API provides the java.util.Properties class which seems to 
> suit well enough for this problem.

Much like the same way you can build a JNDI Context off of a set of 
 properties stored in a java.util.Hastable.

>
> _____________
> Proposal No 3
> Methods provide a means to locally patch the global preferences.
>
>   For some config parameters it makes sense to set them globally for a 
> whole session or even application. For others setting them on a 
> per-request basis may make more sense.
>
> ___________________
> Architecture Sketch
>
> java.util.Properties:
>  - encapsulates preferences as key/value String pairs

>
> httpclient.Configuration:
>  - singleton that holds the global preferences
>  - reads its default values on initialization
>  - provides static convenience methods to access individual parameters
>    Samples:
>    String getValue(String key, Properties localPrefs),
>    boolean isEnabled(String key, Properties localPrefs)
>    (localPrefs is an optional local patch for the global preferences)
>  - provides methods to modify preferences
>
> httpclient.ConfigKeys:
>  - interface that defines the string constants for the keys
>  - contains documentation for each key
>
> httpclient.HttpMethodBase:
>  - provides setting of per-request preferences:
>    setPrefs(Properties)

1.) Would there be a means to assign my own properties object to the 
HttpClient, HttpConnection and HttpMethod objects? So I could control 
the settings on a "client by client", "connection by connection",  or 
"method by method" basis?

2.) Is there a "priority" the architecture levels? ie:

key                                     properties
        client   -->  connection   -->    method     =    actually used

p1      x  --------------------------> y  ------------> y

p2      a  ---------> b  -----------------------------> b    

p3                          n ------------> m  -------------> m  
  
p4      z  -------------------------------------------> z


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to