Changes

Jump to: navigation, search

Memento

10 bytes removed, 18:35, 13 April 2007
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>
== References ==
[http://www.dofactory.com/Patterns/PatternMemento.aspx#_self1 Data & Object Factory]<br />
[http://en.wikipedia.org/wiki/Memento_pattern Wikipedia]
1
edit

Navigation menu