ed Windows 95/NT version that has a completely redesigned, drag-and-drop interface like those available in popular C++ compilers.
We ran TowerEiffel 1.5 (the latest Unix version) on a Sun SparcStation 10 with Solaris 2.4, while we tested TowerEiffel for Windows on a homemade 486/66 with 16 MB of RAM running Windows NT 3.51. The look-and-feel improvements provided by the Windows version are striking, but more important are the design principles embodied in Eiffel itself.
Constructing Programs
Tower Technology markets TowerEiffel as a program-design language (PDL), an approach also used by several Ada language vendors for their compilable packages. PDLs let you express the function of a program in a design language and then compile the design to check it for correctness. To this, Eiffel adds the means to finish the development process.
Eiffel achieves its goals primarily through extensive use and modification of o
bject classes, coupled with a development environment that automatically creates class templates, performs dependency analyses, and permits automatic program builds. For the group method of development that often characterizes large, custom programming efforts, TowerEiffel has a form of built-in source code control. The class directories can be locked, or access can be controlled, so that the programmer can make changes to a root class only with the lock. Shared class directories can also be precompiled to save time in recompilation and relinking.
Programming with Eiffel is like using any
fully object-oriented language
. Rather than starting from scratch, you look for the appropriate object class from which to begin your design. You start with that root class, which forms the basis for the application, create the subclass for the application, define the inheritance properties, and write any unique functions, perhaps making use of other object classes. In Eiffel, any functions a
nd data (methods and messages in object-oriented dialect) that are associated with an object description are known as
features
.
We first examined TowerEiffel in its Unix environment, which is based on a customized version of the
emacs
text editor that provides the indentations and syntactic styles required by Eiffel. Even though emacs commands are often obscure, this version comes with point-and-click editing commands in addition to the usual keystroke commands.
The
Windows 95/NT version of TowerEiffel
, on the other hand, has the look and feel of a Smalltalk class browser. The environment window has multiple tiled panes that let you lay out a class hierarchy sequentially, with point-and-click access to the contents of any object.
Both environments also support development in other languages, particularly C, C++, and Objective C. TowerEiffel can compile directly into an executable application, or it can produce C, C++, or Objective C code, which ca
n then be run through a compiler for one of these languages. The Windows version lets you work with 32-bit C++ compilers from Borland, Microsoft, and Symantec.
Clusters of Classes
Like any good object-oriented system, TowerEiffel provides a comprehensive and well-documented class library. In the base system, there are three general
clusters
. The kernel cluster, which is by far the largest, includes three universal classes -- General, Platform, and Any -- along with basic data structures, memory management, and interfaces to ANSI C libraries. These universal classes provide a wide range of functions that any special-purpose, programmer-derived class can inherit. The support cluster is a mixture of items that's dominated by math operations and constants. The serial cluster provides mechanisms for persistent storage and serialized object streams.
To produce an executable application (known as a
system
in Eiffel terminology), you have to create a text file know
n as an Ace (short for Assembling Classes in Eiffel). The Ace contains the name of the root class from which you derive the application, the compilation options, and a list of directories (or clusters) where any other classes you're using are located. In some ways, it's analogous to a make file in a traditional development language. Once again, the
emacs
editor provides a template of the Ace file, and you just have to change the definition of the system (or application name), root class, and perhaps one or two other items.
Normally you define the Ace file before further specifying the application. This forces you to know your base class and other classes before modifying the class objects or adding other code.
Once this is accomplished, you can create new instances of objects and manipulate them using features that are already in the class, inherited from the class hierarchy, or that you have specifically written as features. (See the sidebar
"Reusable Objects and Reliability"
for an explanation of one type of inheritance, called
constrained genericity
, that permits strict control of the parameters that a generic class can use.)
The Eiffel development process forces you to perform a top-down, object-oriented analysis and design. This is how Eiffel supports both correctness and extensibility.
The final result of creating a program file and an Ace file and then invoking the compiler is an Eiffel system. It supports both garbage collection (i.e., automatically allocating and deallocating memory) and direct control over memory management by the program. You can also take legacy C or C++ code and encapsulate it into an Eiffel object using a class found in the kernel cluster.
A Useful Paradigm
Overall, the Eiffel development process and language remind us of Smalltalk. You don't
write
a program, at least not in its entirety; instead, you
construct
one from existing classes. As with Smalltalk, the learning curve will be
steep for many programmers who are used to working with traditional languages.
Eiffel's Unix roots are mostly a detriment. We could do without the
emacs
editor and the other Unix conventions the product uses. The Unix influence also means that graphical classes are not part of the base system, even in the Windows version (but they are available as an option). In Smalltalk, these classes are closer to the core of the system. Thankfully, the Windows version is much easier to use, and Tower Technology says it will eventually move the new environment to the Unix versions.
Eiffel offers a good blend of styles and approaches. Unlike C++, it forces you to use objects immediately, yet its compatibility with C++ gives you the (perhaps false) confidence that you can always tweak the final result if it becomes necessary. The Windows version of the TowerEiffel System is definitely a worthwhile purchase for C++ programmers who want to work within a pure object-oriented architecture.
PRODUCT INFORMATION
TowerEiffel System............$1555 commercial (for HP-UX, Linux, NextStep,
OS/2, Solaris 1 and 2,
SunOS 4.1.x, and Windows NT)
...............................$249 noncommercial version also available
Tower Technology Corp.
Austin, TX
(512) 452-9455
fax: (512) 452-1721
info@twr.com
http://www.ca.cf.cm.uk/Tower/
Circle 1041 on Inquiry Card.