The Memento design pattern is used to save and restore the previous state of an object. It is commonly used in versioning systems, rollback, and undo functionality. The pattern hides the complexity of saving and restoring the state and provides an easy-to-use history system. However, it requires a lot of memory to store a series of states.

3m read timeFrom proandroiddev.com
Post cover image
Table of contents
Kotlin Design Patterns: Memento ExplainedPurpose of the patternExample

Sort: