Serial port, unix calls, some thoughts

Tim Rowledge tim at sumeru.stanford.edu
Tue May 27 15:32:28 UTC 2003


Bridges. That's the answer m'boy, _bridges_.

Typically a three layer pattern, what y'do is have a
+ Smalltalk utterly-portable class, say SerialDoohickey. Everybody
writing applications uses this.
+ Smalltalk platform specific _translating_ class, the actual bridge.
This accepts messages from SerialDoohickey and does everything it can to
cope with them. For stuff it's platform can support it just passes it
down to the platform code. For other stuff it attempts to simulate as
much as possible and in some case it can raise sensible errors (ie some
capability is required which simply cannot be handled).
+ Platform specific layer ie calls to plugin. By this point we know that
the plugin only has to deal with stuff it knows about and so there is no
problem of RiscOS serial plugin having to try to do something meaningful
to cope with a call only applicable to Sinclair Spectrum OS 3.01 or
whatever.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: SCS: Spurious Cold Start



More information about the Squeak-dev mailing list