Cuireann an patrún Decorator iompraíochta nó freagrachtaí nua ar dhúnmhargadhanna go dinimiciúil trí iad a fholuain — gan an bhunclass a bhréagadh. Soláthraíonn sé rogha fhúirsteanach ar fholuain-dhéanamh chun feidhmiúlacht a leathnú, agus tugann sé deis duit iompraíochta a dhréachtú.
Cad a dhéanann an patrún 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
