A demonstration of a Java hyper-programming system was given in the Demonstrations track of VLDB'99 in Edinburgh, September 1999. This is an overview of the demonstration.
The demonstration starts with retrieval of some persistent data. The Persistent Roots window contains the names of the available persistent roots; selecting one of these results in the corresponding data being displayed in a Browser window.
Here the array PERSONS has been chosen and the first element, an instance of class Person, selected. The Instance pane on the left of the Browser window displays instance-specific information (field values), while the Class pane on the right displays class details (field types, method signatures, constructors, interfaces, superclass).
Since the system is implemented entirely in Java, it is not possible to display the values of non-public fields such as ID or icon. These fields are private, as indicated by the red boxes next to the field names. Other modifiers are also colour coded, summarised in the Modifiers pane:
The values of accessible object fields in the Instance pane are denoted by links. The default appearance is a box containing the name of the object's class, as with the address link. The appearance of links may be customised, as will be described later. Two classes, java.lang.String and javax.swing.ImageIcon, have pre-defined customisations that cause links to be displayed as the string value and the image respectively. This can be seen with the name and picture links above.
Clicking on a link causes the corresponding object to be displayed in the same Browser window. The result of clicking on the address link is shown below.
A link can be displayed in a new Browser window by clicking the Pin checkbox before clicking on the link:
Clicking on a class link, as with the city class field above, displays the details of that class with an empty Instance pane:
Inherited class members can be shown or hidden using the class slider at the bottom of the window. The default display shows only those members defined in the current class. For example, the Person instances above showed only the fields and methods defined in Person, while those inherited from Animal and Object were hidden. The two red controls on the class slider determine the upper and lower limits of visibility. Thus in the example below, all members defined in classes Object, Animal and Person are visible.
A hyper-program may be constructed by inserting links to persistent objects and classes in a hyper-program Editor window. There are several ways to insert a link:
The example below shows the definition of a class MarryExample with links to the static method Person.marry (in blue) and to two instances of class Person (in red). These links are direct references to the corresponding classes and objects. Once the links are established, the system guarantees that they will remain valid for as long as the hyper-program is accessible, regardless of how the original access paths to the objects may change.
Links in the hyper-program editor may be manipulated in the same way as text, e.g. copied, pasted, dragged etc. Clicking on a link causes the corresponding object or class to be displayed in the Browser window.
The label displayed on a link is provided only for convenience: it does not affect the meaning of the link in the hyper-program. The appearance of links may be customised by the user, either on a per-link basis or for all instances of a given class. A customisation for class Person is shown below. This specifies fragments of code that return images to be displayed when instances of the class appear as links in the Browser or Editor window. Where the instance appears in the Browser window the image returned by the getPicture method is displayed, and where it appears in the Editor window a smaller image returned by the getIcon method is displayed.
The resulting customised display of an instance of class Person in the Browser window is shown below:
The customised display of a hyper-program is shown below:
The example above shows a complete class definition used to invoke a single method. It is also possible to invoke methods and constructors directly by clicking on their names in the Browser window. The user is then prompted to supply a fragment of code for each required parameter. The example below shows invocation of the Person(String,ImageIcon) constructor. Each parameter field is itself a hyper-program editor, as illustrated by the link to an image dragged into the second field. Clicking on the Invoke button invokes the constructor and the new object is displayed in the Browser window.
The hyper-code system provides a single unified representation, and manipulation tool, for code and data. The example below shows the persistent roots, each represented initially as a single link. One of the links is about to be exploded to show more detail.
Here the persistent root labelled PERSONS is an array of Person instances. The array is represented within the exploded link as hyper-code, in this case a call to a method to construct an array, with links to the Person instances as parameters. By default links to objects are displayed in red, and links to classes in blue.
The example below shows the result of dragging one of the Person links from the Persistent Roots window into a new hyper-code Editor window, then exploding both the Person link and the Address link within it. Exploded hyper-code links can thus be arbitrarily nested. Note how this view of the Person instance, as hyper-code, contrasts with the non-code-based view provided by the Browser in the hyper-programming system.
Representations of code, i.e. classes, are displayed in the same way. The example below shows the result of exploding a link to the class Person, followed by exploding links to Animal and Address in turn.
The example below shows the composition of a new class definition containing links to both an existing class and an existing object:
When evaluated this returns a link to the new class, which when exploded shows the original source code:
Whereas the unit of evaluation in the hyper-programming system was the complete class definition, any valid fragment of hyper-code may be evaluated. The example below shows the call to the Person.marry method as before:
The style in which links are displayed may be customised in a similar way to the hyper-programming system, as illustrated in the example below:
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