[ENH???] IOHandle

David T. Lewis lewis at mail.msen.com
Sun Nov 21 00:34:57 UTC 1999


--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii


IOHandle adds classes which represent input/output on external channels,
such as files or sockets. The FileStream and Socket hierarchies are
modified to collaborate with instances of IOHandle rather than directly
call primitives.

I did this as an experiment to see if I could move the represention of
external input/output connections into a separate class hierarchy, so as
to take the responsibility for the IO connection out of classes such as
Socket and StandardFileStream. This should help to unclutter the FileStream
and Socket hierarchies, and simplify the job of refactoring these classes.
I didn't bother to make an IOHandle subclass for AsyncFileStreams, but the
same principle would apply.

I think that the IOHandle concept lines up more or less with Craig
Latta's ExternalResource class (a better name for the idea, by the way).
I was paying more attention to file handles than network handles, with
the unix-like idea that all of these external things could be made to
"look like" files.

It is still an open question in my mind as to whether a Socket should
be collaborate with an IOSocketHandle, or if it should itself be a
subclass of IOHandle. I lean towards collaboration, since the Socket
classes contain a lot of behavior which is not directly related to
the IO channel itself.

This change set should not be considered for inclusion in the Squeak image,
as there are some machine dependencies and possible performance side
effects that I have deliberately left in the code. It's just a proof of
concept, but if folks think it's a useful direction, I can clean it up
and make it suitable for real use.

The change set must be loaded in two parts:
  IOHandle-part-1.20Nov513pm.cs
  IOHandle-part-2.20Nov513pm.cs

Please load it into an image you don't mind throwing away, as the changes
are not easily reversed.

Comments?

- Dave

p.s. The change sets are attached in a zip file so as not to overload
inboxes on the mailing list. I tried to put this on minnow, but the swiki
is out to lunch.


--XsQoSWH+UP9D9v3l
Content-Type: text/plain; name="IOHandle.zip"
 ; x-mac-type="705A4950"
 ; x-mac-creator="705A4950"
Content-Disposition: attachment; filename="IOHandle.zip"
Content-Transfer-Encoding: imap_stub

0,1473,2,34336,0,

--XsQoSWH+UP9D9v3l--





More information about the Squeak-dev mailing list