The pattern allows you to preserve and restore the past states of objects, without revealing the details of their implementation.
Imagine that we need to save data about the player. And if the position may well be a public variable, then the player’s condition will be hidden.
The player’s class can independently collect data that needs to be saved and returned to the Memento object. Also, the player's class implements recovery from Memento.
#python #Programming #coding #Java #Programmer #CODER #Computerscience #TECHNOLOGY #Machinelearning #PYTHONPROGRAMMING
TAGS :
LEAVE A REPLY