What's the difference between an Algorithm and a Design Pattern

后端 未结 12 809
轮回少年
轮回少年 2020-12-24 13:54

I was searching for \"Undo/Redo algorithms\" and found something marked as a duplicate, but the duplicate was a request for a \"Undo Design Pattern\". I\'d really like an al

12条回答
  •  囚心锁ツ
    2020-12-24 14:41

    they are different: http://en.wikipedia.org/wiki/Design_pattern_(computer_science) vs http://en.wikipedia.org/wiki/Algorithm

    using the the command design pattern (http://en.wikipedia.org/wiki/Command_pattern), it is easy to implement undo/redo: http://www.cs.mcgill.ca/~hv/classes/CS400/01.hchen/doc/command/command.html

    related question: Design Pattern for Undo Engine

提交回复
热议问题