1
edit
Changes
Memento
,no edit summary
== Description ==
The Memento design pattern is used to store the state of an object so that it can later be restored to that state. In the diagram below the Originator object is creates a Memento that will store it's internal state and can later retrieve that state. The Caretaker makes sure that only is the object that creates the memento will be able to access it to restore it's statestore the date in the Originator. Although if can have other uses, this pattern is often used for undo/redo operations in many different programs.
== Diagram ==
[[Image:mementoDiagram.jpg]]
== Examples ==
<b>This is a simple example of a memento in C#:</b>
<pre>
</pre>
<b>This is a simple example of a memento in Java:</b>
<pre>