Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an "interface extends interface" relationship look like in UML?

Tags:

interface

uml

In Java it's perfectly legal for an interface to extend an interface. Does this relationship in UML look like an "extends" relationship (solid line, closed, unfilled arrowhead) or an "implements" relationship (dotted line, close, unfilled arrowhead)? I can't seem to find an example of this relationship either online or in Fowler's book.

like image 942
Martin Doms Avatar asked Apr 22 '10 22:04

Martin Doms


People also ask

What happens when interface extends interface?

Extending InterfacesAn interface can extend another interface in the same way that a class can extend another class. The extends keyword is used to extend an interface, and the child interface inherits the methods of the parent interface. The following Sports interface is extended by Hockey and Football interfaces.

Can an interface extends an interface?

An interface can extend other interfaces, just as a class subclass or extend another class. However, whereas a class can extend only one other class, an interface can extend any number of interfaces. The interface declaration includes a comma-separated list of all the interfaces that it extends.

How can you identify an interface in a UML diagram?

In UML 1.4 interface was formally equivalent to an abstract class with no attributes and no methods and only abstract operations. An interface may be shown using a rectangle symbol with the keyword «interface» preceding the name.

Can an interface extend from another interface write an example?

Yes, we can do it. An interface can extend multiple interfaces in Java.


1 Answers

Use "extends" (solid line, closed, unfilled arrowhead), which is consistent with how Java uses the extends and implements keywords.

  • "extends" == UML generalization / specialization relationship
  • "implements" == UML realization relationship

The sub-interface is a specialization of the super-interface, not a realization of it.

See http://www.informit.com/articles/article.aspx?p=29224&seqNum=2

Example of interfaces extending interfaces.

like image 84
Bert F Avatar answered Sep 21 '22 07:09

Bert F