Wikipedia's description of the Memento pattern states that:
The internal state of an object should be saved externally so that the object can be restored to this state later.
The object's encapsulation must not be violated.
I am confused as to how can encapsulation be violated? Is it referring to the getter methods of the fields stored in memento?
Aucun commentaire:
Enregistrer un commentaire