Java Reference
In-Depth Information
Figure 17.2
Client collaboration diagram.
the ServerGateway , and the DisplayManager ,inthat order. Those objects
must be created in the order shown because the gateway needs a reference to
the poller and the display manager needs a reference to the gateway. We also
see that DataManager must pass a server reference to PollerThread and
ServerGateway , since both must access the server. Then DataManager must
provide a ServerGateway reference when it instantiates DisplayManager ,
which must provide the reference to InputPane since InputPane needs to
access the gateway. DisplayManager also creates the plot and text output
panes. The InputPane object contains a GUI element permitting the user to
start the simulation.
When the user causes the simulation to begin, several things must happen
during sequence 4. First, InputPane must call the gateway's startSim-
ulation() method. At this time InputPane provides a set of input data
used to initialize the calculation. This data is passed to the server's receive-
Input() method. It is important to note that this data set is different from the
control data that controls the simulation while running. It is also different from
any data used to initialize the remote server object as was done in sequence 2.
The server initialization is done very early, before InputPane even exists. Later,
InputPane presents its GUI to the user and collects the calculation initialization
parameters. These parameters might include, for example, time steps, maximum
run time, or other values that set up the desired simulation. They are passed to
Search WWH ::




Custom Search