Java Reference
In-Depth Information
uniformly, it is obvious that the output panes must not hold the lock for too long.
One way to accomplish this goal is for DataManager to request the lock and
make yet another copy of the data that the output panes use instead of having
the output panes lock and copy the data. Since the output panes and DataMan-
ager 's methods run in the same thread, there is no chance of collisions between
DataManager and the output panes.
Another issue not shown is that the Observable superclass requires that
setChanged() be called in order to mark the Observable object as hav-
ing been changed before calling notifyObsevers() . Otherwise, notifyOb-
servers() does not notify anything because it thinks that nothing has changed.
For simplicity, this detail is not shown in the class or collaboration diagrams but
must be dealt with during implementation.
17.6 Web Course materials
The online materials include more discussion of client design and of the Model-
View-Controller design pattern. Also, there is additional information about UML.
Resources
Model-View-Controller, Design Patterns Catalog , Sun Microsystems,
http://java.sun.com/blueprints/patterns/catalog.html.
Model-View-Controller Architecture, Fundamentals of JFC/Swing , Sun short course,
http://java.sun.com/developer/onlineTraining/GUI/Swing/
shortcourse.html.
Search WWH ::




Custom Search