[Seaside-dev] review Grease stream hierarchy

Philippe Marschall philippe.marschall at gmail.com
Mon Jun 25 19:30:11 UTC 2012


Hi

To fix issue 733 I had to introduce yet another stream wrapper (we
would be so dead without Cog). And now our stream hierarchy is about
to share the same fate as it's brethren. Here's what I did:
We already had GRCodec stream which had about several responsibilities:
 - It defined "our" stream protocol and was an "anchor" for several
packages (JavaScript, Comet, …) to add their class extensions
 - It was sort of a stream decorator base class that delegated to a
concrete stream implementation
 - It was sort of abstract, #nextPutAll: and other methods had to be
implemented and did not delegate (!). But
#greaseNext:putAll:startingAt: did delegate.
 - It was the base class for codec streams although nothing codec
related was there

What I did I create a superclass named GRDelegatingStream, moved all
the behavior there. GRCodecStream is now an (empty) abstract base
class for coded stream. GRCountingStream and GRSwitchableStream are
subclasses of GRDelegatingStream instead of GRCodecStream. I did no
further clean up.

All is not well in the state of Denmark tough. I outlined several
smells in Issue 734 [1]. I would welcome it if somebody could review
the current hierarchy and suggest improvements before it becomes big
pile of mud.

 [1] http://code.google.com/p/seaside/issues/detail?id=734

Cheers
Philippe


More information about the seaside-dev mailing list