Squeak VM, real-time I/O, and threading

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Thu Jan 31 09:18:37 UTC 2002


Howdy!

Craig Latta <Craig.Latta at NetJam.ORG> wrote:
> Hi--
> 
> > I agree with Goran completely on this issue. Subclassing is
> > particularly in-appropriate for network protocols, since they should
> > be stackable.
> 
> 	I think there's some confusion over what artifact we're talking
> about... Göran was talking about Flow's architecture (I think :), but

Yep. Flow. I am not totally confused. :-)

> Flow *does* use composition. A client or server (e.g., HTTPClient) uses
> a stream (e.g., SocketStream), which uses a resource (e.g., TCPSocket).

Oh yes - it is very nicely architected overall. It was just the Client
and Server classes that disturbed me IIRC.

> I guess you're taking issue with the way things are now in mainstram
> Squeak? ("HTTPSocket", etc.)

Well, no, but I agree - the same problem exists in the Sockets hierarchy
in vanilla Squeak.
But you fixed that part in Flow very nicely.

> 	Göran... how would you change the proposed architecture of Flow out of
> concern for composition?

Eh, well, I don't have your code up in any image (nor the time right
now) but I think I would try to rewrite Client and Server into some form
of pluggable components or something. And then they should probably have
some more descriptive name like... Gah... RequestDispatcher instead of
Server? I believe (out of memory) that Server is a bit similar to
ConnectionQueue/ConnectionHandler right? ConnectionDispatcher perhaps.
Whatever.

I want to instantiate one on a port and plug in some guy implementating
a simple protocol getting fed a Stream.
Then it can listen and create Sockets and Streams and Processes etc as
long as my little guy gets called somewhere... :-)

regards, Göran

PS. Client and Server were probably added last (and perhaps with less
thought) and they aren't big classes - but since that is probably where
the beginner starts to look for examples they play an important role in
showing "how yo do it" in Flow. DS

PS. <CSOTD>
"I don't think we need another snippet now that Modules have hit the
town.
God have mercy on our souls. ;-) Henrik - good work! DS



More information about the Squeak-dev mailing list