HandyBoard(r1)is a Java object that in effect loads the run method of a Runnable object r1 into a Handy Board Clearly, one could only have as many instances of the HandyBoard class as one had Handy Boards. This has the nice property that we get a kind of simulator for free. We could have a PseudoHandyBoard class for which the call
PseudoHandyBoard(r1)simply makes a Thread which runs r1. Now, typically for crisply exact real-time performance, much the behaviour of the HandyBoard is characterised by interrupt-routines. To deal with this we'd have another constructor:
HandyBoard(r1,runnables)where the array of runnables (or some other structure) is in effect an array of interrupt routines.
It would also be necessary to make other attributes of the class visible in a similar manner.
It should be noted that instance-variables of the HandyBoard class become globals in these circumstances (for a given Handy Board is an instance of the class.