Yenta
Volume Number: 11
Issue Number: 2
Column Tag: Appletalk
Yenta and the Appletalk Class Library 
ChatterBox for the aspiring MOOSE
By Eric Rosé, cp3a@andrew.cmu.edu
Note: Source code files accompanying article are located on MacTech CD-ROM orsource code disks.
A Historical Note
The infancy of my Macintosh programming life was spent writing network software
and hacking Appletalk code; the scars have mostly healed. IAC and the Communication
Toolbox have made network software easier to write, but there is still a burden on the
programmer to manage zone and node identification, as well as actually sending the data
- especially if you want to provide a different interface than the PPC Browser, or if
you want to communicate invisibly (eg. an e-mail driver which should seamlessly
perform the task of finding other people it can send messages to).
This first part of this article describes the Appletalk Class Library - a modular
and extensible approach to Appletalk communication using Think C++. The ACL is a set
of objects which encapsulate tasks like initializing Appletalk, getting lists of zones,
looking up and confirming addresses, and sending data between nodes. These objects are
fully asynchronous, and provide a way for you to specify completion routines which
can move memory (a big plus!). The second part of this article shows how to use these
classes in conjunction with a number of TCL-like but fully C++ interface classes to
build “Yenta” - a “chat” application in the spirit of Ron Hafernik’s “ChatterBox”
program (yay Ron!).
To Spare You The Trouble
The ACL itself consists of about 2800 lines of code, which clearly prohibits me from
going into all of it in detail in this article. Much of the Appletalk code within the ACL
has been seen before either in IM:IAC or DTS programs such as GetZoneList or DMZ.
My general approach will be to give the declaration for each class I discuss and
describe how it can be used, only showing method definitions when they illustrate some
interesting or important concepts and programming strategies. The interface classes
which I use to build Yenta are also of my own devising and consist of about 9000 lines
of code. Since the focus of this article is on the ACL, I will not discuss them except
when absolutely necessary. All the code for the ACL and the Yenta application is
available from Xplain.
Appletalk Review
Anyone who wants the real lowdown on Appletalk network topology and protocols should
read the second edition of “Inside Appletalk” or Michael Peirce’s book “Programming
with Appletalk”. These details are not important for the development of the ACL, so
this review will talk primarily about what kind of information we have to keep track
of in order to communicate on an Appletalk network.