Java Reference
In-Depth Information
Figure 16.7 UML class
diagram showing the
client's view of the
Server .
the bottom section contains the operations. The middle and bottom sections are
optional. See the example in Figure 16.7.
One of the most important static relationships between classes is inheritance,
discussed in Chapter 4. Inheritance, or the Java extends relationship (which is
known as generalization in UML terminology), is shown with a solid line and a
hollow arrowhead pointing from the child to the parent - i.e. from the subclass
to the superclass. Chapter 17 shows an example of generalization.
A class diagram is a view of the classes from which the objects used in
the collaboration diagram are instantiated. Doing the collaboration diagram first
helps us understand some of the methods needed on the server-side objects. For
example, from the server collaboration diagram, we see that the SimData class
must have getData() and storeData() methods.
What we show here is the client's view of the server, specifically the grouping
of the publicly exposed methods into a Java interface. A Java interface is really a
special kind of class (see Chapter 4) so the UML notation for an interface is similar
to a plain class. An interface is denoted in UML with the << interface >> label.
Strictly speaking, a Java interface is not quite the same thing as a UML interface,
but the differences are subtle enough as to be unimportant for our purposes. So
we freely use the << interface >> notation in our diagrams. In addition to the
<< interface >> label, a common practice is to use a naming convention that
appends the word “Interface” (or sometime just “Ifc”) to an interface class name.
Thus the name of our interface class is ServerInterface . Since the Server
Search WWH ::




Custom Search