Demonstration of Hyper-Programming in Java

Poster

Evangelos Zirintsis, Graham Kirby & Ron Morrison
School of Computer Science, University of St Andrews, Scotland

Hyper-Programming

Traditionally, programs are represented as linear sequences of text. Where a program accesses another object during its execution, such as another program or some data, the program contains a textual description of that object, describing how to locate the object. At some stage during the application building process that description is resolved to establish a link to the object itself. Usually this occurs after the program is written. There is no guarantee that a textual description of an object will remain valid until the time the object is used, even if the description is valid at the time that the program is written. In such systems programs are constructed and stored in some long-term storage facility, such as a file system, separate from the run-time environment which disappears at the end of each program execution.

In an orthogonally persistent system however, programs may be constructed and stored in the persistent store, the same environment as that in which they are executed. This means that the objects accessed by a program may already be available at the time that the program is composed. In this case direct links to the objects can be included in the program instead of textual descriptions. A program containing both text and links to objects, by analogy with hyper-text, is a hyper-program.

The diagram below shows an example hyper-program, comprising a class definition containing two links. The first is to a class, Person, while the second is to an object that is an instance of that class.

Hyper-Program Example

The use of hyper-programs has a number of potential advantages:

Demonstration Overview

The demonstration shows a prototype hyper-programming system based on the PJama persistent version of Java. An example of the user interface is shown below. It provides two main tools: an editor in which hyper-programs are composed, and an object/class browser that is used to locate persistent objects for linking. The browser is also used in conjunction with the editor for viewing hyper-programs: when the programmer clicks on a link in the editor, a representation of the corresponding linked entity is displayed in the browser. The top window shows a hyper-program under construction in the editor. The body of the main method contains links to a static method, Person.marry, and to two instances of class Person. The lower window shows the object browser, currently displaying details of one of the object instances in the left pane, and the object's class in the right pane.

By default, the editor displays hyper-links as textual labels. It is also possible to customise the display style on a per-object or per-class basis. The object/class browser can be similarly customised. Here is an example in which both editor and browser have been customised to display instances of classes Person and javax.swing.ImageIcon using appropriate bitmaps.

Non-customised: Non-customised Example

Customised: Customised
Example

The following activities are illustrated during the demonstration:


Hyper-Code

Current research is directed at refining the concept of hyper-program to remove all distinctions between multiple program forms. The goal is to maximise simplicity for the programmer. A single, uniform, program representation is presented at all stages of the software process. Since this representation must be suitable for programs with closure, by implication it must be a form of hyper-program that can represent links to persistent values directly. To distinguish it from previous prototypes we refer to this representation as hyper-code.

The PJama hyper-program system falls short of this goal in several respects. Different representations are used for creating new values and browsing existing values: new values are created by writing hyper-program source definitions, while existing values are displayed graphically in the object/class browser. Secondly, full representations are not provided for all existing values, in particular it is not possible to view method source code.

The hyper-code system addresses these deficiencies by retaining all source code in the persistent store, and by providing the same single representation of values at all stages of the software process. As a consequence the distinction between editor and object browser disappears: all programmer interaction with the system takes place via a single unified hyper-code editor. This supports a small set of simple operations that can be composed orthogonally to achieve all programming activities:

Implementation of this scheme in any particular language involves mapping the operations to the syntax of the language, and designing an appropriate hyper-code representation that can be used both to define new programs and represent existing values, in all possible cases. The example below shows a fragment of Java hyper-code containing several exploded links.

Hyper-Code Example


Further Information

The hyper-programming and hyper-code prototypes are freely available via the links below.

St Andrews Group: http://www-ppg.dcs.st-and.ac.uk/
Hyper-Programming: http://www-ppg.dcs.st-and.ac.uk/Research/HyperProgramming/
(Java system): http://www-ppg.dcs.st-and.ac.uk/Research/HyperProgramming/Java/
Hyper-Code: http://www-ppg.dcs.st-and.ac.uk/Research/HyperCode/
(Java system): http://www-ppg.dcs.st-and.ac.uk/Research/HyperCode/Java/
PJama: http://www.dcs.gla.ac.uk/pjama/

Email: {vangelis, graham, ron}@dcs.st-and.ac.uk


Last Updated: 3-Dec-1999 by Graham Kirby