Roland, Looks very good to me. Many thanks for your continued efforts.
I also tend to think that Odi has made a good point about the decorator pattern, but the exact details of each and every class and interface cannot be determined at this point, and they are not meant to be final anyways. As to http-multipart, there are plans to factor the multipart related stuff out and merge it with commons-codec http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/codec- multipart/ Unfortunately there as been no progress made on that front for months, so the outcome of this endeavor is far from being certain. Still, architecture-wise this seems a better option to me. All we would have to do is to provide MultipartIcEntity and MultipartOgEntity out of http- client package, which is already dependent commons-codec anyways Cheers, Oleg On Thu, 2005-01-20 at 13:47 +0100, Roland Weber wrote: > Hello folks, > > as I have briefly mentioned in a previous mail, I would like to > move the handling of HTTP entities into dedicated classes, > instead of having it in method implementations. The main > reasons for this are: > > 1. entities have to be put into HTTP responses as well, though > these tend to be more simple than the multipart entities > frequently found in requests > 2. all entity enclosing methods (in particular POST and PUT) > should provide identical means for defining entities, without > having to duplicate code > 2. on the server side, a method will provide access to the > enclosed entity but does not allow to define it > > In the light of Oleg's attempts to make request and response > objects useful on both client and server side, I believe that > separate entity handling classes will simplify re-use. And > here is my first take on it: > > > http-common: > > HttpEntity interface > HttpOutgoingEntity extends HttpEntity (was: RequestEntity) > HttpIncomingEntity extends HttpEntity > > BasicEntity implements HttpEntity > BasicOgEntity extends BasicEntity implements HttpOutgoingEntity > BasicIcEntity extends BasicEntity implements HttpIncomingEntity > > StringOgEntity extends BasicOgEntity > ByteArrayOgEntity extends BasicOgEntity > InputStreamOgEntity extends BasicOgEntity > > FormDataOgEntity extends BasicOgEntity > based on code currently in PostMethod > > OutputStreamIcEntity extends BasicIcEntity > ByteArrayIcEntity extends BasicIcEntity > > (Rename EntityEnclosingMethod to something that can > reasonably be implemented by HttpResponse as well?) > > > http-multipart: > > MultipartOgEntity extends BasicOgEntity > based on current code in o.a.c.hc.methods.multipart > (Part, PartBase, StringPart, ByteArrayPart, FilePart > PartSource, ByteArrayPartSource, FilePartSource) > > MultipartIcEntity extends BasicIcEntity > based on Commons FileUpload - as a future extension > > > What do you think? I will take care of updating the > design document once we have reached a consensus. > > cheers, > Roland > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
