On Sun, 2006-05-28 at 13:44 +0200, Roland Weber wrote:
> Hi all,
> 
> I have completed a first version of the wiki page on the HttpAsync design:
> http://wiki.apache.org/jakarta-httpclient/HttpAsyncThreadingDesign
> 
> I will later add details about the use of background threads in dispatcher
> implementations, but I want to gather some feedback on the design level
> first. In particular, I'm interested in your opinion on the red vs. cyan
> design question. The current implementation is based on the red design.
> 
> Note: as all communication on this mailing list, this request for review
> is addressed to _everyone_, not just to the usual suspects. If you have a
> view, please share it with us. Rationales are welcome, but not required.
> 
> cheers,
>   Roland
> 

Hi Roland,

It's great. I wish I had a half of your ability and patience to document
design alternatives I confront. 

Overall the design sounds solid. I have only a few comments to throw in
the mix:

(1) "Applications must process responses as they arrive"

I personally try to avoid 'modal' APIs at all costs, as inevitably there
are always cases where one may be tempted to use the API in a wrong
mode. A friendly reminder to RTFM usually is a small consolation to
someone who wasted hours debugging the problem in her code just to find
out the API was used in a funny way.

If the problem cannot be resolved at the API level, an effort should be
made to provide a detection mechanism throwing an IllegalStateException
if an attempt is made to process responses in a wrong sequence. 

(2) red vs cyan

Both approaches have their merits, pros and cons. I tend to lean toward
the cyan as I believe it will entail better code structure. Presently,
there are areas in the HttpAsync code which _might_ get somewhat cleaner
if requests / responses were pre-/post-processed on the dispatcher
thread (for instance, AsyncHttpProcessor _may_ no longer be required)

Cheers,

Oleg   



> ---------------------------------------------------------------------
> 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]

Reply via email to