1 Preface
We borrowed the idea of pasting similar objects to save the object state and restore it later. The status itself is created as an object (instant post ). It encapsulates the internal state of the original object. Only the original object that is created as an instant sticker can understand the Saved state and use it to restore the original state. A Design Pattern carefully designed from this idea is called the memorandum pattern.
2. Details
2.1 Brief Introduction
Capture the internal state of an object without damaging the encapsulation, and save the state outside the object. In this way, the object can be restored to the previously saved state.
2.2 When to use
(1) You need to save the state of an object (or a part) at a certain time point so that it can be restored to the previous state;
(2) The interface used to obtain the status exposes the implementation details and needs to be hidden.
3 conclusion
The above is all content and I hope it will help you.