Difference between Strategy pattern and Delegation pattern

后端 未结 4 1498
小蘑菇
小蘑菇 2020-12-28 16:13

What is the difference between Strategy pattern and Delegation pattern (not delegates)?

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 16:53

    if you meant strategy pattern vs delegates, as in functions/lambdas passed as arguments, then at least I know there is less overhead in terms of classes that need to be compiled for delegates.

    I actually found this page looking for someone to give me their thoughts on the benefits of still using the design pattern route given that both java 8 and C# now support passing functions as arguments

提交回复
热议问题