Java Reference
In-Depth Information
Figure 17.1
A simplified class diagram of the client application.
called by
notifyObservers().
This action can be assumed to occur behind
the scenes, courtesy of the Java class library's implementation of
notifyOb-
servers()
.
DataManager
also contains
PollerThread
,which has a dependency on
the
Server
class, which implements the
ServerInterface
. Also missing
from the diagram so far is any indication of how this server object is instantiated.
Note that this
Server
isn't the actual server-side server object described in
Chapter 16, but rather some client-side construct that knows how to communicate
with the real server. Just how the client-side server object actually communicates
with the real server object is discussed in Chapters 18 and 19. In practice, the
client-side server object is obtained from an analogous client-side representation
of the server factory object using the Factory Pattern, as explained in Chapter 16.
For simplicity, we've also omitted from the above discussion any mention of
the controller component. Recall that our design includes the capability for the
user to control certain aspects of the simulation as it is running by passing an array
of control variables to the server in the
retrieveData()
method call. One can
imagine some sort of user-adjustable values controlled by GUI elements - buttons,
checkboxes, sliders, etc. - in the
PlotPane
and/or
TextPane
windows, or per-
haps in a new
InputPane
class. As is common in Swing applications, the view
and controller components are often merged, at least in the user interface if not
in the design. In any case, these input values must somehow be communicated to
Search WWH ::
Custom Search