The memento design pattern provides us the functionality of reverting to a previous state of an object when needed. It comprises of three different roles that will have to be created in order for it to work. These three roles are:Originator- The originator is the object that will be saving its state for us to revert to later. Caretaker- This is theobject that will save as well as restore the state of the originator when each of these actions are required. Memento- The object that is used by the caretaker to store the state.
1 Impression