[Seaside-dev] Issue 293 in seaside: Refactor WAResponse and subclasses to encapsulate stream and use WriteStream instead of ReadWriteStream

codesite-noreply at google.com codesite-noreply at google.com
Fri Jan 23 08:05:55 UTC 2009


Comment #16 on issue 293 by renggli: Refactor WAResponse and subclasses to  
encapsulate stream and use WriteStream instead of ReadWriteStream
http://code.google.com/p/seaside/issues/detail?id=293

#14: Yeah, theoretically it should work. Still it is tricky to move things  
around and it happens all the time that
things get lost or obsolete classes end up in packages. This is a bug in  
Monticello we can't do much about it
other than being careful. Therefore I would prefer to discuss issues about  
moving things beforehand, instead
of moving them back and forth between packages.

#15: Unfortunately the tests did not cover all of the public protocol. I  
improved that with my last commits.
Also I think I should comment the subclasses of WAResponse, I think you  
misunderstood their purpose. Loading your changes broke Seaside-Adaptors,  
Seaside-RenderLoop, Seaside-Canvas, and all the JavaScript
packages. All these packages depend on the fact that there is a stream  
within the response that can be written
to. The streams provided by the two subclasses are not the same. For  
WABufferedResponse the stream is
supposed to act as a buffer for the body of the response. It should be  
possible to reset it. For
WAStreamedResponse the stream is an external stream (in Squeak this is a  
SocketStream) where the complete
response is written to. The class makes sure the headers are written at the  
right time and become immutable,
before the first client tries to write something to the body.

Again, I do not really understand your changes. The actual implementation  
of WAResponse did not change
since Seaside 2.7. I only reorganized the hierarchy, renamed some methods  
(#contents is now called #stream)
and added some new tests. The kind of streams that are used are exactly the  
same as in Seaside 2.7.

Probably you want to answer your own custom stream object from "WAPlatform  
current readWriteStream" that
does support the necessary conversion and protocol. In Squeak this is  
handled by the class
RBBinaryOrTextStream. The at the end of the handling, the server adaptor  
resets the stream and passes it to
the Server that then reads from it to produce the final response body. This  
avoids unnecessary copying of
large objects. I don't see any other read behavior in use though.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the seaside-dev mailing list