In PlantUML, how to put a label when using the class X extends Y syntax?

Viewed 178

I have a class diagram using this PlantUML syntax:

@startuml
class A
class B extends A
@enduml

How do I add a label for the arrow? My only constraint is that I cannot use the <|-- syntax due to some other reasons. So I need to keep using this extends syntax...

1 Answers

You can try this

@startuml
class A
class B extends A
class C

A -> C : label1
B -> C : label2
B --> A : label3
@enduml

enter image description here

Or just use note

@startuml
class A
class B extends A
class C

A -> C 
B -> C 
note left of A : Note 
@enduml

enter image description here

Related