Het Decorator-patroon voegt dynamisch gedrag of verantwoordelijkheden toe aan objecten door deze in te pakken — zonder de originele klasse aan te passen. Het biedt een flexibel alternatief voor subclassing om functionaliteit uit te breiden, waardoor je gedragingen kunt samenstellen.
Wat het Decorator-patroon doet
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
