Design Patterns Java™ Workbook

(Michael S) #1
Appendix C. UML at a Glance


  • Use a dashed arrow between classes to show a dependency that does not use an object
    reference. For example, the Customer class uses a static method from the
    LikeMyStuff recommendation engine.


Interfaces.....................................................................................................................................................


Figure C.3 shows the basic features for illustrating interfaces. Following are notes on
interfaces.


Figure C.3. You can indicate an inter-face with either an «interface» stereotype or
a lollipop.


  • You can draw an interface by placing the text «interface» and the name of
    the interface in a rectangle, as Figure C.3 shows. You can use a dashed line and a
    closed, hollow arrowhead to show that a class implements the interface.

  • You can also show that a class implements an interface by showing a line and circle,
    or "lollipop," and the name of the interface.

  • Interfaces and their methods are always abstract in Java. Oddly enough, interfaces and
    their methods do not appear in italics, unlike abstract classes and abstract methods in
    classes.


Objects.........................................................................................................................................................


An object diagram illustrates specific instances of classes, as Figure C.4 shows. Following are
notes on object diagrams.

Free download pdf