In this video you'll learn about the memento pattern which allows an object's state to be saved and restored later.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3816-ios-design-patterns/lessons/7
In this video you'll learn about the memento pattern which allows an object's state to be saved and restored later.
Thank you for this video.
I suppose that Care Taker, cares only to โtagโ the data and gives them to the originator. This tag probably is the โkeyโ that help us to create โversionsโ of the same object.
I keep that in my mind
Saving
Restore
So Care taker must know how to tag, and match tags with objects in order to save and restore.
The objects need to be encodable, in order to be acceptable from the care taker.
The originator storage the data from the encoded object and the tag from the care taker as pair.
A very nice pattern.