What is Decorator pattern?

  • A design pattern that allows objects to be decorated with additional responsibilities, dynamically, at runtime
  • A design pattern that creates objects by cloning existing objects, rather than creating new instances from scratch
  • A design pattern that filters a set of objects based on certain criteria and returns a subset of those objects
  • A design pattern that separates an object's implementation from its interface, allowing the two to vary independently
Decorator pattern is a design pattern that allows objects to be decorated with additional responsibilities, dynamically, at runtime. The pattern involves creating a decorator class that wraps the original object, adding the new responsibilities to the original object's behavior. This pattern can be useful in situations where you want to add or remove responsibilities from objects dynamically, without affecting the behavior of the original objects.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *