The Constructor

The constructor for a Bill Data object simply initializes the URL and Image variables with the two parameters passed in. Initializing the pixel array is done in a separate method, because it is very processor intensive. This gives the applet a chance to only initialize the pixel array when it needs it.


In previous versions of Dynamic Robert used static variables within tiff recent transition classes to store data that only needed to be inlt lizcd once. It was red, however, that when more than one instance of the applet from a web serve ~.the applets would share the static variables. This led to some problems if one led a different static value than the other when the applets were different Are is the Fade Transition class’ used to create an array whose size depend dimensions of the applet. When Dynarnicllillboard was created with dime that were smaller than the previous apple], it would overwrite tl-is array ,an array too small or the first applet, This would cause the first applet to crash.

Robert introduced tIle static hash table called object_table in this version of the applet to work around this problem. Now transition classes can store data inside this hash table using the transition name in with the applet size as a key. When .this data. needs to be used, the applet can look to see if it exists for the applet’s size within the hash table. If it does not, then it can create the data and store it in the has table for later use. Now if there is more than one applet on a web server and both’ are the same size, then only one has to initialize the data.

[vfb id=1]

Share This