Search code examples
umlclass-diagram

In class diagrams, should classes implementing an interface have the method names repeated?


I'm creating some UML diagrams, and I have a large number of classes implementing an interface.

Is it necessary for these classes to also list the methods of the interface? It sounds quite trivial but will make the diagram look much simpler if they do not.

Here is an image to show what I mean:

UML diagram showing a class implementing an interface with the interface's method names repeated in the class
(source: yuml.me)

Any implementation of MyInterface requires method1, method2 and method3 - so can these be left out?


Solution

  • I often refer to Agile Modeling's class diagramming guidelines. You'll find your question answered in section 3, "Interfaces".

    Quick answer: They can be left out.