tkWWWInternals
Basic architecture
tkWWW consists of two processes
- A frontend GUI (Graphical User Interface)
- the frontend GUI is responsible for all user interaction and is coded
completely in tk. It responds to user input and issues commands to the
server backend.
- A backend server (tkWWW.server)
- the backend server is written in C using TCL and www libraries, and is
responsible for getting html files over the network and parsing them into
commands that are to be executed by the frontend GUI.
The design philosophy behind tkWWW is to put as much as functionality as
possible into the interpreted frontend GUI rather than the compiled backend
server. The server is responsible ONLY for network interaction and parsing HTML
files. All of the special functions of tkWWW (like the history mechanism,
bookmarks, and annotations) are coded in interpreted frontend rather than in
compiled backend.
General guidelines
- Follow the KISS (keep it simple stupid) principle
- Worry about ease of use before worrying about speed
- Minimize the amount of code that is to be written. Whenever possible use the
functions in the WWW client library.
- The resulting code should be able to run using an ordinary version of wish.
- Put as much into the graphical frontend as possible. It is far easier to
edit the interpreted graphics frontend instead of editing the interpreted
backend.
- Follow the MOTIF style guide as much as possible. Using a standard user
interface makes it easier to figure out what is going on.
Naming and Programming Conventions -- Frontend
All tk procedures and global variables should be named tkWWW(filename) where
filename is the name of the tk file in which that procedure or variable is found
.
Exception: The procedures in hypertext.tcl begin with tkW3Ht. This is to
minimize the amount of traffic between the frontend and the backend.
Naming and Programming Conventions -- Backend
All commands to the backend server should begin with Ht. The only file in which
Ht commands should be found is navigate.tcl. All other files should call
procedures in navigate.tcl to communicate with the backend.
The frontend should not expect the backend to save any state.