Modeli Decorator dinamikisht shton sjellje ose përgjegjësi në objekte duke i mbështjellë ato — pa modifikuar klasën origjinale. Ai ofron një alternativë fleksibël ndaj nënklasifikimit për zgjerimin e funksionalitetit, duke ju lejuar të kombinoni sjellje.
Çfarë bën modeli Decorator
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
