4

For class diagrams, the examples I've seen look like

class A{
  [snip] list of class features
} 
class B{
  [snip] list of class features
}

A <|-- B

i.e. the inheritance arrow is explicitly called out.

Is there a valid synax where I can just say something like:

class A{
} 
class B: public A {
}

and automatically getting the inheritance arrow in the resulting diagram?

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
Dave
  • 7,555
  • 8
  • 46
  • 88
  • I don't know what exactly [plantuml](http://plantuml.sourceforge.net/qa/) can do and what are your reasons why you want/need to use it. But: there are tools capable of reverse engineering real-life code into UML class diagrams from real-life languages including C++, Java, PHP, C#... with inheritance, attributes, methods.. you can try following query to find some related off-topic Stack Overflow articles: http://stackoverflow.com/search?q=uml+reverse+engineer+class+diagram – xmojmr Oct 06 '14 at 18:35

1 Answers1

10

Yes. Both inheritance and interface implementation are supported.

class A extends B
class C implements D

However, the members are not duplicated in the classes. It simply takes care of the relationship arrow.

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111