A Decorator minta dinamikusan hozzáadja a viselkedést vagy felelősségeket az objektumokhoz azáltal, hogy becsomagol azokat — az eredeti osztály módosítása nélkül. Rugalmas alternatívát nyújt az alosztályozásnak a funkció kiterjesztéséhez, lehetővé téve a viselkedések összeállítását.
Mit csinál a Decorator minta
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
