This chapter covers the Memento pattern.
Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.
The word memento is a reminder of past events. By following an object-oriented approach, you can also track (or save) the states of an object. So, whenever you want to restore an object to its previous state, you can consider using this pattern.
In this pattern, you commonly see three participants: memento, originator, and caretaker (often used as a client). The working flow can be ...