object-oriented / Java
Representation
Collected by Craig S. Miller — Interview, James Riely
Graphs make the relevant parts of program state explicit and support detailed explanations by instructor.
PL | NM |
---|---|
stack frame | red rectangle, with method name and line number in left compartment, boxes for paremeters and local variables in right compartment |
object | purple rectangle, with class name in left compartment, boxes for instance variables in right compartment |
array | blue rectangle consisting of boxes for elements |
static fields | yellow rectangle, with class name in left compartment, boxes for class variables in right compartment |
variable | box inside a rectangle |
reference value | solid arrow pointing to a rectangle |
primitive value | value written inside a box |
callee-caller relationship | dashed red arrow from callee stack frame to caller stack frame |
Program state, and especially variables and references.
To demonstrate how Java code advances through a computation, e.g., when working data structures.
Quick and easy to use, even when live-coding a solution
James Riely developed and described a tool, in the form of a Java class, Trace.java, that produces graph representations of the Java program state in the form of GraphViz dot graphs.
He uses it in his CSC300 course at DePaul University. Here is one of the lecture videos, showing the traversal of linked lists.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".