From 6a6fe20ebb7885534bb70f669cbdcf5b481bb421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 24 Aug 2014 23:05:51 +0300 Subject: [PATCH] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1f17ae712..3a6d5555e 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,12 @@ ##Memento **Intent:** Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later. +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/memento/etc/memento.jpg "Memento") + +**Applicability:** Use the Memento pattern when +* a snapshot of an object's state must be saved so that it can be restored to that state later, and +* a direct interface to obtaining the state would expose implementation details and break the object's encapsulation + ##Observer **Intent:** Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.