Strategy Pattern V/S Decorator Pattern

后端 未结 7 1304
星月不相逢
星月不相逢 2021-01-29 20:06

I just came across two patterns.

  1. Strategy Pattern

  2. Decorator

Strategy Pattern :-

Strategy pattern

相关标签:
7条回答
  • 2021-01-29 20:55

    It boils down to this: Use Strategy to choose one piece of core functionality. Use Decorator to add extra functionality. Strategy is the cake we're making and Decorator is all the pretty decorations we're adding to it.

    0 讨论(0)
提交回复
热议问题