---
# System prepended metadata

title: PlantUML Klassendiagramm
tags: [PlantUML]

---

# PlantUML Klassendiagramm

```plantuml
'!include https://hackmd.io/N9tcamRTQ46jhVv-FIo1lg\download
''!include https://hackmd.io/N9tcamRTQ46jhVv-FIo1lg\download
' https://oer-informatik.gitlab.io/uml/umlklasse/plantuml/umlclass.cfg

hide circle
skinparam classAttributeIconSize 0

skinparam DefaultFontName "Lucida Sans Typewriter"

skinparam Class{
    BorderColor DarkSlateBlue
    BackgroundColor whitesmoke
	 'Verhaltensmuster grün #CBFF9A
     'Erzeugungsmuster blau #99DCFF
     'Strukturmuster rosa ##F9BD97

}

skinparam Interface{
    BorderColor DarkSlateBlue
    BackgroundColor whitesmoke
}

skinparam Note{
    BorderColor DarkSlateBlue
    BackgroundColor LightYellow
}

skinparam ArrowColor DarkSlateBlue

'skinparam FooterFontColor Lavender
'skinparam FooterFontSize 8
right footer CC BY 4.0 Hannes Stein \n https://oer-informatik.de/uml-klassendiagramm-plantuml

'Optionen:
'left to right direction
'skinparam lineType ortho
'skinparam lineType polyline

' Add spacing horizontal and vertical
' skinparam nodesep 50 
' skinparam ranksep 50

' A Package just to group members
skinparam package<<invisible>> {
  borderColor Transparent
  backgroundColor Transparent
  fontColor Transparent
  stereotypeFontColor Transparent
}

' Schatten deaktivieren
' skinparam shadowing false


interface ObservedSubject<<interface>> {
    + addObserver(Observer): void
    + removeObserver(Observer): void
    + notifyObserver(): void
}

interface Observer<<interface>> {
    + update(): void
}

class TankDaten {
    - observers: Observer[]
    - fuellstaende: int[]
    - fuellstaende_datum: string[]
    + setDaten(int[], string[]): void
    + getFuellstaende(): int[]
    + getFuellstaende_Datum(): string[]
    + addObserver(Observer): void    
    + notifyObsevers(): void  
    + <b>removeObserver(Observer): void</b>
}

class Dashboard {
    - tankDaten: ObservedSubject
    - fuellstaende: int[] 
    + Dashboard(o : ObservedSubject)
    + display(): void
    + <b>update(): void</b>
}

class History {
    - tankDaten: ObservedSubject
    - fuellstaende_datum: string[]
    + History(o: ObservedSubject)
    + display(): void
    + <b>update(): void</b>
}

TankDaten *-r- Observer #red
TankDaten --|> ObservedSubject
Dashboard -u-|> Observer
History -u-|> Observer
```
