← BYTES
Design Patterns·Starter·Ref: 17.1.11
What is the purpose of the Memento pattern?
Have a question about this video? Mention reference 17.1.11 when you contact us.
a.To capture and externally store an object's internal state so it can be restored to that state later, without violating the object's encapsulation
b.To permanently delete an object's state
c.To compare two objects' states for equality
d.To merge two objects' states into one
Memento lets an object (the 'originator') save a snapshot of its own internal state into a separate memento object, which can later be used to restore the originator to that saved state -- commonly the mechanism behind undo functionality -- without exposing the originator's internal implementation details to the code managing the snapshots.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES17111#DesignPatterns