It is possible to write your own programs from scratch, which is probably the ideal way of using the learning object. However before you attempt to do this you must be aware of the limitations of the current version of this software and understand how it work.
When the jvmrlo compiles and analysis a program it discoveres where user objects are created (using the new keyword), and then logs the values of the fields of each object whereever it is referred to in the code after this point. It then creates a table of these values so that when you step through the program the state of the object at that point can be detected. When a loop is encountered, only the last pass through it is tracked and recorded as has been mentioned in Getting started with the jvmrlo. For conditional statements, the jvmrlo only tracks the path actually taken so for example if we were to step through the following lines:
1 if(args.length == 1) {
|
then if we step down through the code, and there isn't a single command line argument then nothing will appear on the Heap until we reach line 4.
The Java programming language provides a range of ways of creating new objects. Explicit instantiation of a class can be done using the new operator, by invoking the newInstance() method on a class or java.lang.reflect.Constructor object, by invoking clone() on an existing object or by deserializing an object using the getObject() method of the java.io.ObjectInpuStream class. Implicit object creation can also take place such as the String objects that hold the command line arguments, through the process of evaluating an expression that involves the string concatenation operator or during the process of class loading. Because version 1 of the jvmrlo has been specifically targeted at giving novice programmers the only form of explicit object creation supported is through the use of the new operator, with the intenstion of introducing some of the other methods in a later version.
Another limitation is that program statements are restricted to one per line, so for example a statement like
1 ...
|
A further limitation, is that when stepping to a line containing multiple object references in a single program statement as shown below.
1 ...
|
In this case only the object c1 will appear on the Heap when we step to line 3 and object c2 will be visually ignored. At the present time it is recommended you seperate out such references into seperate lines of code such as:
1 ...
|
Once again it is hoped that in a later version of the software that right and left arrow keys will enable the user to skip across a statement and display the various object found.
A problem occurs with the assignment of null to object references before they have been used. This is a temporary bug in the software that will be fixed in due course.
When creating programs to run using the jvmrlo, you should structure you code into a demonstration class that is used to instantiate instances of other classes that belong to the same package. Whilst this is clearly a limitation of the application, it should be sufficient for novice users or for instructor demonstration purposes.