10

I'm trying to understand how can I draw a UML diagram of a program that extends one class and implements another interface. I've made this sketch but I'm not sure if it is correct.

A is a class that has some fields and methods and B is an interface which has some methods. And finally C is extending from A and implements B. ( like public class C extends A implements B in java)

enter image description here

srk
  • 4,857
  • 12
  • 65
  • 109
azuosxela
  • 210
  • 1
  • 7
  • 15

1 Answers1

17

Your diagram is almost correct. The left generalization is drawn like a unfilled triangle.

enter image description here

Edit: In Enterprise Architect you can show the generalization also with the general class written in italics top right of the generalizing class:

enter image description here

Obviously this is a pure Sparxian invention as their support does not have an explanation for its origin.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • I've never seen that general class in italics in the UML spec. Do you have a reference? – Jim L. Apr 17 '16 at 23:45
  • @JimL. I'm using that with Enterprise Architect and they are quite compliant. I'll try to find the source in Superstructures. – qwerty_so Apr 18 '16 at 04:42
  • @JimL. It seems that you are right and this notation is an invention of Sparx. I have made an edit to my answer and wi'll ask Sparx for the rationale. – qwerty_so Apr 18 '16 at 06:01