Interface Diagrams


You have two principle ways in which to diagram an interface: You can diagram the interface itself, and you can show within the diagram that a class implements the interface.

Figure 11-1 shows a diagram that represents an interface. The first line, called the stereotype, describes what the box represents, and the second line provides the name of the interface. Below that you find the methods of the interface. You can then optionally create a diagram that has an arrow going from a class to the interface, to indicate that it implements that interface.


Figure 11-1: A typical interface diagram

Figure 11-2 shows a diagram using a type of shorter notation, referred to as the lollipop notation. This notation doesn t provide details about the interface but rather merely that a class implements it. The interface name appears in the circle, and a line connects it to the class that implements it (in this case, Course ).


Figure 11-2: This diagram shows that a class implements the interface.

The shorter notation obviously saves space and is simpler to reproduce, but it s best used for well-known interfaces, whether in the language or the application itself.




OOP Demystified
OOP Demystified
ISBN: 0072253630
EAN: 2147483647
Year: 2006
Pages: 130

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net