0

For example, right now I'm creating a diagram for some classes that extend java's Exception class. Do I just completely model the Exeption, and therefore the Throwable class and Serializable interface? Or do I just leave the Exception model blank and extend from that placeholder class? Can I just put <<extends java.lang.Exception>> in the head of the class?

lenny
  • 734
  • 2
  • 15
  • 43
  • Can you provide us with what you already have? It will help us get a clearer image of your question so we can help you better. – Quadrivics Dec 02 '19 at 10:48
  • See https://stackoverflow.com/questions/23169691/uml-class-diagram-how-to-show-a-class-extends-thread/23169830#23169830 – qwerty_so Dec 02 '19 at 10:51

1 Answers1

1

The goal of the diagramming is increasing clarity. In most cases, you do not have to model the language, it is enough that you show inheritance to Exception, with Exception shown as a class with no properties (as those you can consider irrelevant/known).

Yet if your documentation is going to be read by someone who is not familiar with Java and you think those elements of Java are important to clearly pass the information, you will have to model additional standard Java classes as well.

The documentation does not specify any other way of presenting inheritance than through a generalization relationship, so using a stereotype-like notation will not be UML compliant.

Ister
  • 5,958
  • 17
  • 26
  • This is true given that you don't want to generate code from your UML model. That is a whole other ballgame. – Geert Bellekens Dec 02 '19 at 11:50
  • okay, thanks. That's what seemed most logical to me but I wasn't sure if there's some kind of rule in UML regarding this, like marking the Exception class as language class or some fun stuff. Also, not generating any code from diagrams, @GeertBellekens. Not yet anyway – lenny Dec 02 '19 at 16:04