Appendix C. Code Listing for UML Exercise

The following code represents the classes that have been derived from the UML diagrams in Section 3.5 in Chapter 3. This code has been produced by first analyzing the structure specified in Figure 3.5 and then the behavior specified in Figure 3.4. For simplicity, we have omitted using the eventhandler package from Figure 3.6.

 /** TimeChangeListener.java This is the interface which the TimeEventSource objects "know how to talk to." In our example, TimePrinter objects which implement this interface are registered with the TimeEventSource. */ public interface TimeChangeListener extends java.util.EventListener { public void timeChange(TimeChangeEvent t); } /** TimeChangeEvent.java This is our event object. ...

Get Java™ Design: Objects, UML, and Process now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.