[gnu.g++] ET++ description

bryan@UUNET.UU.NET (Bryan Boreham) (06/28/89)

OK, so my mailbox filled up with letters saying "Just what is ET++
anyway?". So here's the description I wrote for my colleagues in
March, from reading the paper described below, before I had seen any
source code. It stands up well in the light of my actual experience
with the system.

The papers on ET++ are:

- Andre Weinand, Erich Gamma, Rudolf Marty, 
  Design and Implementation of ET++, a Seamless Object-Oriented Application
  Framework, 
  Structured Programming, Vol. 10, No. 2, 1989 Springer Verlag.

This issue will appear in June but a copy of this paper is included in the
distribution from Zurich.

- Erich Gamma, Andre Weinand, Rudolf Marty,
  Integration of a Programming Environment into ET++ - A Case Study

To be presented at ECOOP89 in Nottingham



ET++, a Seamless Object-Oriented Application Framework
======================================================

ET++ is a set of classes for  C++ to  help implement applications like
those found on the  Macintosh. It was written  on the Sun to run under
SunView, but the system-dependent bits are  very localised, and it has
already been ported to the X11 and NeWS window systems on the Sun.

For  starters, it implements  classes  for  basic building blocks like
lists, arrays, sets,  etc., and graphical  objects  like  circles  and
rectangles.  It  uses the Smalltalk  concept of a master  class called
Object,  and  everything  inherits  from  this.    Many functions  are
implemented high up in  the inheritance tree,  and can be used by  all
classes below.

All objects inherit PrintOn and  ReadFrom methods that store instances
of  objects in files,  including  all referenced  objects.  Cycles are
detected  in    the  reference   graph. Change  propagation    is also
implemented in  Object: for all objects declared  to be dependent upon
another object, all modifications   to the latter trigger  the  Update
method in the dependent ones.

Because C++ gives  no access at run-time to  informations such as  the
names  and types  of instance variables,  ET++ has  for   each class a
descriptor object, analogous to Smalltalk's metaclass. This is done by
requiring  that the programmer  writes  a short macro call beside each
class  definition   and  implementation.   Once   this  information is
available, it can be used to do run-time type checking when using many
different types of object  (e.g. in a  collection of shapes), and  for
the input/output  methods. It is also used  by  the   ET++ programming
environment, which we shall come to.

Every graphical  object that appears  on the  screen  is a subclass of
VObject.  One  such subclass   is  a   CompositeVObject, consisting of
several VObjects,  and in    this way  everything,   from  application
documents to dialogs and menus, is built up.

The Application Framework Classes implement much of the donkey-work of
interactive  applications,  and are    modelled  after  Apple's MacApp
system. The abstract  class  Document holds the  data  structure of an
application,  and   is responsible for  opening and  saving documents.
Things  like "Do you want  to  save changes before  quitting" are done
automatically in the abstract class.

The class View represents a drawing  surface,  and handles things like
scrolling within a window, multiple windows open on the same document,
etc. A Document can be displayed in different  Views in different ways
-  a  spreadsheet and  a graph, for  example. Changes are buffered and
output to the screen when ET++ is idle, giving a flicker-free update.

All user commands are implemented as subclasses  of the abstract class
Command, which ET++ uses to manage undo operations.

Dialogs are declared  to ET++ in  the source code as a  list of  their
contents,  and the  system  places  them on the  screen in  a pleasing
manner:

   This Source Code:                              Produces:
   -----------------                              ---------

   new Cluster(VCenter,                         --Direction---
     new BorderItem("Direction",               |              |
       new OneOfCluster(cIdMode, Hleft,        | [x] Forward  |
           "Forward", "Backward", 0)           | [ ] Backward |
     )                                         |              |
   )                                            --------------

Obviously, the automatic placement can be  overridden, but  anyone who
has  set up a  complex dialog using  the Mac Resource Editor will know
that this is a boon.  If you translate  the text to German, the  boxes
expand and move to accommodate.

A subclass of View, CollectionView, displays a collection  of VObjects
in various ways, as a static list for menus, as  a scrollable list for
choosing filenames,  or  as  an array for   tool  pallettes. It  could
equally well implement a super-spreadsheet.

Various    types of TextView  go    far beyond   the  Mac's  TextEdit.
CodeTextView  is  for displaying and  editing  source code,   and does
auto-indenting and   pretty-printing; RestrictedTextView only   allows
input corresponding   to   a   particular    regular expression,   for
"numbers-only" fields,  etc. VObjectText allows  any VObject to appear
as part of the text, in the same way that Mac  Word allows graphics to
be pasted in. If you have been listening, it should be clear that this
allows buttons to be part of the text, for hypertext, and even dialogs
and scrollable windows can appear inside documents!

So far, this system is pretty wonderful, or so I think. But what is it
for?  Well, the designers have implemented  a pretty nifty MacDraw for
the  Sun,   but, just like C,  ET++   is most useful for  implementing
itself.

The ET++ Programming Environment  implements a browser system for ET++
applications. By holding down the control, shift and  meta  keys while
clicking, any object on the screen  is displayed, showing the instance
variables and methods.  References to other  objects  can be followed,
and  the  source code for  the  methods changed.   ET++ has  a dynamic
linking system, so changes can be  compiled and integrated  whilst the
application is still running. The class hierarchy can be  displayed as
a tree on the screen, and all the superclasses investigated also.

The current version of ET++ consists of 234 classes with 2343 methods,
in 43494   lines  of C++.  The SunOS and  SunWindows parts  come to 11
classes, 4719 lines.

It's in the public domain, and you can get a copy for $100 from

Institut fuer Informatik
University of Zurich
Winterthurerstr. 190
CH-8057 Zuerich
Switzerland

Or anonymous ftp at sirius.nada.kth.se (130.237.222.29) in the file
pub/et++-1.0.tar.Z. Size 6.5Mb.

Or from cayuga.cs.rochester.edu (192.5.53.209). ET++ is split into
four pieces, in the files pub/et++-1.0.tar.Z[1234].

Or, if you're in the UK, you can send me 40 pounds and I'll send you
a Sun DC600 tape.

Bryan Boreham			bryan@kewill.uucp  
Software Engineer	||	bryan%kewill@uunet.uu.net
Kewill Systems PLC	||  ... uunet!mcvax!ukc!root44!kewill!bryan
Walton-On-Thames	
Surrey, England		Telephone: (+44) 932 248 328

PS: I got Tom Vijlbrief's name wrong in my posting earlier. Sorry.