Memento: State Encapsulation.

Torky 2 months ago 0
Instead of having the Memento and the Object coupled on private attributes being declared in both classes (State). We can encapsulate these elements in a State object with a known interface, hence different states can be used and classes are less coupled.