Skip to Content
Java Design Patterns: A Hands-On Experience with Real-World Examples
book

Java Design Patterns: A Hands-On Experience with Real-World Examples

by Vaskaran Sarcar
May 2022
Intermediate to advanced
678 pages
11h 48m
English
Apress
Content preview from Java Design Patterns: A Hands-On Experience with Real-World Examples
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
V. SarcarJava Design Patternshttps://doi.org/10.1007/978-1-4842-7971-7_20

20. Memento Pattern

Vaskaran Sarcar1  
(1)
Garia, Kolkata, India
 

This chapter covers the Memento pattern.

GoF Definition

Without violating encapsulation, the Memento pattern captures and externalizes an object’s internal state so that the object can be restored to this state later.

Concept

As per the dictionary, the word memento is used as a reminder of past events. Following the object-oriented way, you can also track (or save) the states of an object. So, whenever you want to restore an object to its previous state, you can consider using this pattern.

In this pattern, you commonly see three ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Design Patterns: A Hands-On Experience with Real-World Examples

Java Design Patterns: A Hands-On Experience with Real-World Examples

Vaskaran Sarcar
Java Concurrency in Practice

Java Concurrency in Practice

Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea
Modern Java in Action

Modern Java in Action

Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft

Publisher Resources

ISBN: 9781484279717Purchase LinkPublisher Website