Class Diagram

Best used for a single bounded context, not a codebase.

Class Diagram: rendered example
Rendered by Gnomon from the source below. No edits.

The source

38 lines of PlantUML, and needs nothing beyond the bundled engine. Copy it, or open the template inside Gnomon and render it as it is.

@startuml

title Class Diagram

abstract class Animal {
  - name: String
  - age: int
  + getName(): String
  + makeSound(): void
}

class Dog extends Animal {
  - breed: String
  + fetch(): void
  + makeSound(): void
}

class Cat extends Animal {
  - indoor: boolean
  + scratch(): void
  + makeSound(): void
}

interface Trainable {
  + train(): void
}

Dog ..|> Trainable

class Owner {
  - name: String
  - pets: List<Animal>
  + addPet(animal: Animal): void
}

Owner "1" *-- "0..*" Animal : owns

@enduml

Render this offline

This template ships in Gnomon and renders on your machine, with no account and nothing sent to a server. The browser editor is free and needs no install.

Get GnomonOpen the browser editor

Others in UML and standard diagrams