Decorator
A decorator is a pattern that makes it possible to extend the business logic of a specific functionality at run-time dynamically. The decorator pattern works as a business component wrapper, intercepting the call method that is responsible for executing the function. In other words, this pattern decorates the original business object by packaging the same object and providing additional functionality while also keeping the existing functionality intact. The decorator pattern is a structural design pattern.
This pattern dynamically changes the way in which an object functions at run-time without impacting the existing functionality of the objects. In short, this pattern adds additional behavior to the object by wrapping it.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access