On Sun, Jan 01, 2006 at 06:19:46PM +0100, Ortwin Gl?ck wrote:
> Hi Oleg,
> 
> As promised I have taken time and reviewed the http-core code. Here are 
> my thoughts.
> 
> _________________________________________
> HttpClientConnection/HttpServerConnection
> 
> Currently the two interfaces look quite different: while the client 
> interface offers fine grained methods to send headers and body 
> separately, the server interface does not provide similar functionality. 
> This should be harmonized.
> 
> The client interface competes in functionality with the 
> HttpRequestExcecutor.
> 
> I conclude the following:
> 
> The sendRequest method should be removed from the HttpClientConnection. 
> Sending a whole request is the job of the executor which already handles 
> entity enclosing requests. It should also take care of requests without 
> an entity.
> 
> Add a sendRequestLine method instead. sendRequestHeader should then 
> accept a HttpRequest instead of a HttpEntityEnclosingRequest.
> 
> Likewise the sendResponse method in HttpServerConnection should be 
> broken apart into sendResponseHeaders and sendResponseBody, so an 
> executor has more control over the details. Currently the default 
> implementation does not use an executor.
> 

Odi,

Do you think this will make a better interface?

Oleg

interface HttpClientConnection extends HttpConnection {

   ...
 
    void sendRequestHeader(HttpRequest request) throws HttpException, 
IOException;

    void sendRequestEntity(HttpEntityEnclosingRequest request) throws 
HttpException, IOException;

    HttpMutableResponse receiveResponseHeader(HttpParams params) throws 
HttpException, IOException;

    HttpEntity receiveResponseEntity(HttpParams params) throws HttpException, 
IOException;
    
}


interface HttpServerConnection extends HttpConnection {

   ...
 
    HttpMutableRequest receiveRequestHeader(HttpParams params) throws 
HttpException, IOException;

    HttpEntity receiveRequestEntity(HttpParams params) throws HttpException, 
IOException;

    void sendResponseHeader(HttpResponse response) throws HttpException, 
IOException;
    
    void sendResponseEntity(HttpResponse response) throws HttpException, 
IOException;
    
}


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

Reply via email to