The memento pattern will be the last pattern that we will discover together. You will see that this pattern is really interesting to work with and has many uses.
The role of the memento pattern is to capture an object's internal state and save it externally so that it can be restored later without breaking the encapsulation of this object.
The generic UML class diagram is defined as the following:
The following are the participants of the memento pattern:
Memento: This is the class for the objects that saved the internal states of origin objects (or part of this state), such as the introduction of the fact ...