Sunday 21 May 2023

PlantUML : extension relation in class diagram

We can specify class extension using the symbol <|--

 

classExtension.txt

@startuml

title "Class Inheritance or extension"

abstract class Mammal

Class Dog
class BullDog
class Poodle
class Beagle

class Cat
class PersianCat
class Ragdoll

Mammal <|-- Cat
Mammal <|-- Dog

Dog <|-- BullDog
Dog <|-- Poodle
Dog <|-- Beagle

Cat <|-- PersianCat
Cat <|-- Ragdoll

@enduml

 

Above snippet generate below diagram.

 


 

Previous                                                    Next                                                    Home

No comments:

Post a Comment