设计模式学习18 Memento
应用场景:
在软件的构建过程中,某些对象的状态在转换的过程中,可能由于某种的需要,要求程序能够回溯到以前的状态。
Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later. 仅仅是在外部新增加一个类,然后在这个类中保存类的状态信息。
在软件的构建过程中,某些对象的状态在转换的过程中,可能由于某种的需要,要求程序能够回溯到以前的状态。
Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later. 仅仅是在外部新增加一个类,然后在这个类中保存类的状态信息。