What is the difference between Strategy pattern and Visitor Pattern?

后端 未结 11 1682
灰色年华
灰色年华 2021-01-29 22:18

I have trouble understanding these two design patterns.

Can you please give me contextual information or an example so I can get a clear idea and be able to map the dif

11条回答
  •  梦谈多话
    2021-01-29 22:50

    I'll try to make the shortest answer.

    The two patterns complement one another: for instance, you could use a visitor to change the strategies on all the nodes of a graph.

提交回复
热议问题