Home > Software design >  Classes that inherit from interfaces but implement additional methods in UML diagram
Classes that inherit from interfaces but implement additional methods in UML diagram

Time:09-22

I have to do an UML class diagram for a project in which I implement an interface with abstract methods for RL algorithms. I implement several algorithms that implement an interface but implement additional methods depending on the algorithm. How can I capture that in an UML diagram? I have thought in including a box with the generic name "Algorithm" and the attributes and methods "Algorithm specific attributes/methods", would that be correct in the UML framework?

CodePudding user response:

A class should not inherit an interface but realize (aka implements) it. Graphically, you'll use the same notation than inheritance but with a dashed line:

enter image description here

Your case is a classic case of interface realization, as you'll find for example in a enter image description here

  • Related