TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: Paul Edwards
from: Frank Malcolm
date: 1995-04-11 21:55:02
subject: zmodem object

Hi, Paul.

PE> Let's assume I was writing Zmodem in an object oriented language.
PE> What are the applicable objects here?

PE> Is there a Zmodem object, with two operations, send() and
PE> receive()?

PE> Is there a send object with an operation of zmodem() and
PE> another operation of sealink() and another operation of
PE> xmodem()?

PE> Are zmodem send and receive simple operations, like
PE> patmat()?

PE> Are zmodem send and receive two separate objects, both with
PE> one operation, perform()?  [this is what I think is the
PE> solution at this exact instant of time].

PE> The zmodem send and receive have some code that is common to
PE> both.

I think you treat it like Borland has with their TStream object. (I
don't know whether they provide this (class?) in C; as you know I write
Pascal.) A TStream is an object which has 14 methods, plus Init
(constructor) and Done (destructor). A TStream is an abstract class
which doesn't do anything, but its descendent classes are useful. In
their standard (Pascal) library they provide descendants TDosStream and
TEmsStream, and TBufStream as a descendent of TDosStream.

You might have a TCommsStream descended from a TStream, with, perhaps,
TZmodemStream descended from that. Obviously some methods would be
irrelevant to a zmodem stream; Seek for example should return an error.
(Hmmm, maybe not in am TZmodemStream.) You would implement the
constructor and destructor, and at least TZmodemStream.Read &
TZmodemStream.Write. Others may also be relevant.

Obviously I've used Pascal notation, I'm sure you can see how that would
be done in C, but I find the "dot" notation more explicit.

I don't know whether your Borland C package provides these objects, if
not let me know & I'll try and post the relevant bits from the help
file.

Regards, FIM.

 * * Even a hawk is an eagle among crows.
@EOT:

---
* Origin: Pedants Inc. (3:711/934.24)
SEEN-BY: 690/718 711/809 934
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.