Visual programming to the extreme: no hand-typed code, no waiting
Raymond GA Cote
Prograph CPX from Prograph International of Halifax, Nova Scotia, is a pictorial development environment and application framework for the Macintosh. It supports custom extensions and provides optional support for communicating with corporate databases. The Prograph environment consists of several major subsystems: an interpretive development environment and debugger, an ABC (Application Builder Class) framework, and a separate compiler for creating stand-alone executables.
Prograph is object-oriented and data-flow driven, with a dynamic development environment. The publishers claim it will slash hundreds of hours off your development time. And it will soon be available on platforms other than the Macintos
h (see "Crossing Platforms"). This product sure has all the right buzzwords, but can it deliver on its promises?
What a Pretty OODL
Object-oriented programming is such a common concept these days that I won't belabor the point except to say that Prograph, like SmallTalk, really is object-oriented. Everything is an object. This provides a great deal of flexibility, such as the ability to identify object types at run time and make decisions based on the type.
Such a true object-oriented approach has the potential of adding significant processing overhead to any application. In practical terms, this does not seem to be a major liability on modern machines. I ran the Prograph development environment on a Macintosh 9150 Power PC Workgroup Server, a PowerBook 540, and an old Macintosh IIci. Although the interpretive development environment can be a bit sluggish at times, the final compiled executables run satisfactorily.
The concept of a dynamic development environment is
not new--SmallTalk being the classic example--but it is still fairly rare. In a dynamic development environment, everything, including the executing program, is available for examination and modification. This means that you can take an application and change its underlying code, window layouts, and even class hierarchies while the program is executing and immediately see how the changes alter the program's behavior.
If the integrated debugger pops up with an error, you can examine the problem, modify or rewrite the method exhibiting the problem, and then continue execution starting from where your changes alter the possible flow of execution. You can even write your programs in a top-down fashion without defining the lower levels of functionality until the program is running. The debugger simply states that you are accessing a method or attribute that has not yet been defined and asks if you want to define it now.
Where Has All the Data Gone?
Perhaps one of the most diff
icult concepts to grasp in Prograph is that the basic program execution follows a data-flow model. Data-flow languages provide little control over the order in which sections of a program are executed. And, truth be told, you usually don't care about the execution order. If a low-level primitive requires three parameters, the primitive executes as soon as the three parameters are available, regardless of what else needs to be completed. Although this concept is fairly foreign to most C and C++ programmers, it is a convenient way of envisioning program execution. Simply take a piece of data and follow it around your program.
In real-world applications, some operations must take place in a specific order (e.g., update a database entry before reading it from another part of the program), and Prograph imposes execution order through the use of synchro links. But even with synchro links, Prograph does not guarantee that one operation will occur immediately after another, only that the second operation will
occur after the first.
Although this is the first data-flow language I've used, I became comfortable with thinking in terms of data flow after a day or two of using Prograph. You'll probably find the data-flow concept easier to grasp than your first attempts at learning C++.
Who Needs Pictures?
The overwhelming first impression of Prograph is that of either a CASE or a drawing tool. Everything is visual. Projects are
composed of sections
, which are composed of universal procedures, persistent data objects, and methods. Methods, in turn, are composed of cases, which, in turn, contain
the actual code
. All the elements at each level are represented by pictures. At no point in Prograph will you open up a large text window and start writing the "real" code. The real code is created by placing a set of built-in (or user-defined) primitives onto a methods window and then drawing lines to link these pictures together to form a program.
Being from the old school of programming (I'll happily regale you with tales of paper tape and punch cards), this is about as far removed from traditional programming as I can get. Where's the text? How do I see the overall program flow? And how does all this picture stuff work, anyway? Don't assume that just because Prograph is based entirely on pictures that it is simple, intuitive, or a toy; it is none of these. What it is, is consistent, powerful, and expressive.
Over the years, I have tried a number of picture-based development environments and CASE tools, many of which claimed they would simplify my development environment. Many of these tools were just collections of pretty icons that contained ordinary traditional code. Prograph is different from any other tool I've used. It provides a language as rich and complex as SmallTalk or C++ but in pictures, not words.
Drawing on Experience
The first thing you must do after installing Prograph is work through the tutorial
. Otherwise, you'll just be frustrated by the experience. Prograph is loaded with options. You can click, double-click, command-click, and option-drag command-click to perform an operation. Clicking on the left or right side of an icon produces different actions. There are even multiple controls with various options tucked into the title bar of several windows.
It sounds complicated when you first read through it, and indeed, it remains so for the first few hours. You'll quickly find, however, that what Prograph lacks in simplicity it makes up for in consistency. Command-clicking always performs the same type of action, as does double-clicking the left side versus the right side of an icon (the left side creates things, and the right side provides a list of preexisting things, such as methods).
Intuitive is probably the last word I would choose to describe Prograph. Without the tutorial, you'll never be able to figure out how to perform even the simplest operations. This is not a criticism of t
he product. After all, how intuitive did you find C or C++ to be the first time you tried to learn it?
Prograph is a complex and powerful tool that requires a serious investment in time and effort. After working with Prograph for about a week, I feel comfortable building some simple one- and two-window forms and working with some databases. It will probably take another two or three weeks before I can stop referring to the reference guide every 5 minutes. However, three to four weeks to become comfortable with a new language is not a large investment of time.
Learning ABC
No development environment today is complete without its own class library or framework. Prograph provides the ABCs and ABEs (Application Builder Editors). Every application contains a single instance of the application class. Applications, in turn, are composed of menu, window, and document classes.
Building the user interface consists of creating a set of menus and windows, associating behaviors
with the menu items and the window control elements. You can define behaviors for each event that is appropriate for a particular control item (e.g., double-click, key-down, update, and others). The object editors also let you define Balloon Help text items.
Editors are provided for each of the control item types. You can define new editor types for new controls. The tutorial shows how to define a new chart control that has its own editor.
The ABC library is rich and expressive; aside from the usual window and menu control elements you expect to see in any framework, you'll also find classes for printing, delayed tasks, font control, color and image manipulation, database access, image dragging, and rubber banding. The interactive development environment was built using the ABC library and is an excellent demonstration of the library's capabilities.
At the other extreme to the ABC library is the set of medium- and low-level primitives. Here you'll find functionality from simple bit and s
tring manipulations to serial-port control, AppleEvent interfaces, AppleTalk, QuickTime, and a full set of Macintosh Toolbox primitives up through System 7.1. Using the built-in extension capability, it is fairly easy to add support for new Toolbox functionality, such as the Drag and Drop or Speech managers available in System 7.5.
Extensibility
One problem with non-mainstream development environments is determining what to do with all your old code. Prograph provides two solutions to this problem. You can create new primitive functions, or you can simply treat your old code as an extension.
Creating a new primitive requires you to take the existing source code and encapsulate it in a wrapper that provides access to the Prograph internal structures, such as objects, strings, and lists. Primitives can also communicate with the interpretive environment to provide error conditions.
Most of the primitives provided in the Prograph environment are written in Symantec C. P
rimitives can be written using either Symantec's Think or Apple's MPW C compilers. Sample MPW and Symantec projects are provided, which you can modify to fit your own needs. Writing new primitives may require you to significantly alter your existing code to take full advantage of the Prograph structures, but it provides the tightest coupling of the environment with your old code.
Extensions are useful for including large amounts of existing C or Pascal code in your Prograph environment. To create an extension, you first create a standard Symantec Think or MPW code library. You then run this library through the C or Pascal Interface Tool for Prograph to produce a package. You copy the package into an Extensions folder on the Macintosh, where it is immediately available for use within Prograph. Although Extensions are not as tightly integrated into the Prograph development environment as Primitives (e.g., you would not use Prograph native data structures), they are a quick and convenient way to gain acce
ss to lots of existing code.
Building Applications
Prograph ships with both an interpreter and a compiler. After your final application is developed and debugged in the Interpretive environment, you start up the compiler to create the final double-clickable application.
The compiler has a minimal interface. Beyond letting you set some application specifics--the Finder ID, heap size, and various system flags--it simply compiles the application. If the compiler finds an error, such as an undefined method, it flags the error and provides you with the option of switching to the interpreter environment to fix the problem. Be prepared with lots of RAM if you have both the compiler and interpreter running at the same time--each requires about 7 MB.
The resulting applications run noticeably quicker than in the interpretive environment. They are also significantly smaller. Whereas the development environment requires about 7 MB, the smallest application size appears to be ar
ound 512 KB when using the ABC framework. One sample program that manipulates images, performs database access, and provides several data-entry screens required around 700 KB and took 4.5 minutes to build. As with most frameworks, the resulting executables seem too large for small, frequently used utilities. However, the 500-KB executable size is comparable to other frameworks.
Conclusion
Prograph CPX is a rich and powerful development environment. Once you become familiar with the system, its three-layered approach of framework, rich primitive set, and comprehensive set of low-level Toolbox calls provides the unbeatable expressive power of an abstract framework with the functionality of direct communication with the operating system.
Coupled with the interpretive development environment, this extensibility lets you quickly develop sophisticated applications. The major drawback to this environment is its availability on only a single platform, but that should be changing s
oon.
ABOUT THE PRODUCTS
Prograph CPX $695
(includes 90 days of free technical support)
Interapplication Communications Toolkit $99
Charting Objects $99
Visual Effects Manager $149
C Tool (for creating extensions) $199
Communications Toolbox $299
SQL/DAL interface $999
(includes 10 deployment seats; >10: $75 per seat)
Oracle interface $999
(
includes 10 deployment seats; >10: $75 per seat)
Sybase interface $999
(includes 10 deployment seats; >10: $75 per seat)
SNA gateway $9950
(> 50 seats: $
100 per seat)
PDN (Prograph Developer Network)
(subscription includes three CDs per year plus technical support)
PDN/Bronze $399
per yearE-mail support
PDN/Silver $999
per yearE-mail and voice support; 48-hour response
PDN/Gold $1499
per yearE-mail and voice support; 24-hour response
U.S. Sales Office:
Prograph International, Inc.
447 Battery St.
San Francisco, CA 94111
(800) 927-4847
fax: (415) 391-3942
Internet: info@prograph.com or
sales@prograph.com
Newsgroup: comp.lang.prograph
AOL: prographer
Use keyword Prograph to access the Prograph
Forum
AppleLink: prograph.sls or prograph.spt
Prograph folder in the Third Parties folder
CompuServe: 7330,3460
GO MACDEV, topic Object-Oriented
Prograph FirstClass BBS: (902)455-6616
screen_link (34 Kb
ytes)
Each application is composed of sections. Each section can contain a set of universal methods, persistent objects, and classes. Classes consist of attributes (local variables) and methods.
screen_link (50 Kbytes)
Raymond GA Cote is a BYTE consulting editor and vice president of product development at Appropriate Solutions in Peterborough, New Hampshire. He can be reached on the Internet at
rgacote@apsol.com
or on BIX c/o "editors."