Das Decorator-Pattern fügt Verhalten oder Verantwortlichkeiten dynamisch zu Objekten hinzu, indem es diese umhüllt — ohne die ursprüngliche Klasse zu modifizieren. Es bietet eine flexible Alternative zu Subclassing für die Erweiterung von Funktionalität und ermöglicht es dir, Verhaltensweisen zusammenzustellen.
Was das Decorator-Pattern bewirkt
DECORATOR → WRAP an object to add behavior, keeping the same interface:
→ the decorator wraps the original, adds its behavior, and delegates to the original
→ you can STACK decorators (wrap a wrapped object) → compose multiple behaviors
→ adds functionality WITHOUT modifying the original class or using subclassing
→ "wrap to extend" — flexible, composable behavior addition
