Q. When would you use the GOF Decorator design pattern?

  • (A) to translates an existing class interface into a compatible target interface
  • (B) to assign more functionality to an object without sub-classing it
  • (C) to decouple an abstraction from its implementation so that the two can vary independently
  • (D) to nest layers of decorators to add more functionality
πŸ’¬ Discuss
βœ… Correct Answer: (B) to assign more functionality to an object without sub-classing it

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
303
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate