Q. When would you use the GOF Decorator design pattern? (Solved)
1. to translates an existing class interface into a compatible target interface
2. to assign more functionality to an object without sub-classing it
3. to decouple an abstraction from its implementation so that the two can vary independently
4. to nest layers of decorators to add more functionality
- b. to assign more functionality to an object without sub-classing it