Depicting Interfaces in UML

Figure 9.1 shows the relationships between the Sellable interface and its two implementations. Notice that interfaces in UML can be depicted in two different ways in a class diagram. The Sellable interface is shown very much like a class description with only the addition of the <<Interface>> stereotype to differentiate it. This form is useful when you want to include the details of an interface contract. As a slight change to our earlier example, the JavaBook class is also shown to implement the Cloneable interface. This interface is shown using a notation that does not include any details of the interface. This form is appropriate when the interface details are not needed to convey information about the class design. ...

Get Special Edition Using Java 2 Standard Edition 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.