Interfaces

 <  Day Day Up  >  

Because interfaces are a special type of inheritance, the notations are similar and can cause some confusion. Earlier we said that inheritance is represented by a line with an arrowhead. An interface is also represented by a line with an arrowhead ”but the arrowhead is connected to a dashed line. This notation indicates the relationship between inheritance and interfaces, but also differentiates them. Take a look at Figure 10.5, which is an abbreviated version of an example in Chapter 8, "Frameworks and Reuse: Designing with Interfaces and Abstract Classes." The Dog class inherits from the class Mammal and implements the interface Nameable .

Figure 10.5. UML diagram of an interface relationship.

graphics/10fig05.gif

 <  Day Day Up  >  


Object-Oriented Thought Process
Object-Oriented Thought Process, The (3rd Edition)
ISBN: 0672330164
EAN: 2147483647
Year: 2003
Pages: 164
Authors: Matt Weisfeld

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