“撤消”的最佳设计模式特征 [英] Best design pattern for "undo" feature

查看:67
本文介绍了“撤消”的最佳设计模式特征的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

撤消引擎的设计模式

一般来说,您在应用程序中处理支持撤消功能?我已经在网络应用程序和桌面应用程序上工作,我从来没有真正感到任何撤消系统感到舒服。

In general, how do you deal with supporting an "undo" feature in your application? I have worked on web apps and desktop apps alike, and I have never really felt comfortable with any "undo" system I've made.

推荐答案

我认为应该是命令设计模式。

I believe it should be Command design pattern.

以下是有关命令的多级撤消/重做的文章模式。

Here is article about multilevel Undo/Redo with Command pattern.

编辑:第二个关于多层次的Undo / Redo与Memento模式。

Here is second about multilevel Undo/Redo with Memento pattern.

所以可能两者都可以完成。

So probably it can be done with both.

这篇关于“撤消”的最佳设计模式特征的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆