用途
备忘录模式 (Memento)
在不破坏封装性的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态。
这样以后就可将该对象恢复到原先保存的状态。
这样以后就可将该对象恢复到原先保存的状态。
备忘录模式是一种行为型模式。
结构
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlQAAADGCAIAAACby4kfAAAgAElEQVR4nOydZ0ATSRuAo4gFBMvZzjt7Q+zY7kPPcnZE8TxFT7Gggu0siMopSkBpgoKK6GEDQaSKIiKKioKCgAWkg1JC7yVAQsrufD8G1jUJJMFgIpnnF5l9t2R32Cc7O/MOBSAQCAQCIWdQpH0ACAQCgUB8b5D8EAgEAiF3IPkhEAgEQu5A8kMgEAiE3IHkh0AgEAi5A8kPgUAgEHIHkh8CgUAg5A4kPwQCgUDIHUh+CAQCgZA7kPwQCAQCIXcg+SEQCARC7kDyQyAQCITcgeSHQCAQCLkDyQ+BQCAQcgeSHwKBQCDkDiQ/BAKBQMgdSH4IBAKBkDuQ/BASBWMBnCvtg0DIKjgXYA3SPggEAgB5kh8GcLa0j0EOwBoAzpH2QUgXHGAsAHBpH4ZMguSHkBnkRn44F3DrpX0QCDkAxwC3DskPgZBx5EJ+LBarCtHGVFdXYxgm7UstZdhstrSvgyzC4ch5YwBCFpEL+Xl4eAxEtDHDhg0rKCiQ9qWWMg8ePJD2dZBFoqOjpX1lEAhe2qv8cMCtA6DxQcTFxWXSpEmhoU9CQ+6Hhj4ORUgaFxeXrl275ubmSveqSwMccOsB3ljTfHx8RowYERoaGvr4fmhoiLQvi/S5f/9+r169IiIipHuREAh+2q/8SJ0OXFxc5s+fj3oitB0JCQnyKj9ArlQ+Pj6TJ09uKpT3RmAAQE1NTf/+/ZH8EDJIe5XfVzTJD9FWyLX8SHyRHwIAgOSHkGGQ/NoAnCtvz5dIfhAkPx6Q/BAyC5KfpMExwKkhXgK1HNqKrYu/yvcAyQ+C5McDkh9CZkHyawtEMB/OBdxasWWGMWVzjDCSHwTJjwckP4TMguQnOXA2wJ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xyF+AADHIX4AAMchfgAAxyF+AADHIX4AAMchfgAAxyF+AADHIX4AAMchfgAAxyF+AADHIX4AAMf5F5zPyMfyxGT0AAAAAElFTkSuQmCC" alt="" />
图-备忘录模式结构图
Memento : 负责存储 Originator 对象的内部状态,并可以防止 Originator 以外的其他对象访问 Memento。
Memento 有两个接口,Caretaker 只能看到备忘录的窄接口,它只能将备忘录传递给其他对象。
Originator 可以看到一个宽接口,允许它访问返回到先前状态所需的所有数据。
Memento 有两个接口,Caretaker 只能看到备忘录的窄接口,它只能将备忘录传递给其他对象。
Originator 可以看到一个宽接口,允许它访问返回到先前状态所需的所有数据。
class Memento { private String state; public Memento(String state) { this.state = state; } public String GetState() { return state; } }
Originator : 负责创建一个备忘录 Memento,用以记录当前时刻它的内部状态,并可使用备忘录恢复内部状态。
Originator 可根据需要决定 Memento 存储 Originator 的哪些内部状态。
class Originator { private String state; public void SetState(String state) { this.state = state; } public String GetState() { return state; } public Memento CreateMemento() { return (new Memento(state)); } public void SetMemento(Memento memento) { state = memento.GetState(); } public void Show() { System.out.println("State = " + state); } }
Caretaker : 负责保存好备忘录 Memento,不能对备忘录的内容进行操作或检查。
class Caretaker { private Memento memento; public void SetMemento(Memento memento) { this.memento = memento; } public Memento GetMemento() { return memento; } }
测试代码
public class MementoPattern {
public static void main(String[] args) {
Originator o = new Originator();
o.SetState("ON");
o.Show();
Caretaker c = new Caretaker();
c.SetMemento(o.CreateMemento());
public static void main(String[] args) {
Originator o = new Originator();
o.SetState("ON");
o.Show();
Caretaker c = new Caretaker();
c.SetMemento(o.CreateMemento());
o.SetState("OFF");
o.Show();
o.SetMemento(c.GetMemento());
o.Show();
}
}
运行结果
State = ON
State = OFF
State = ON
State = OFF
State = ON