|WikiProject Computer science||(Rated Start-class, Low-importance)|
|WikiProject Java||(Rated Start-class, Low-importance)|
The Java example is correct, the C# example is flawed. The C# example got to go. My personal opinion is that a stack is often a better solution than memento.
I would like to request more information on the role of the CareTaker. From the explanation and the samples, it is not clear as to what the purpose of the CareTaker is. Specifically, why would you store the Memento in the CareTaker and not in the code that contains the instance of the Originator. The CareTaker appears to serve no purpose other than to complicate the design. 22.214.171.124 (talk) 01:50, 21 March 2008 (UTC)
I would use Vector instead of ArrayList in CareTaker, because ArrayList does not take care of sorting. 126.96.36.199 15:06, 11 January 2007 (UTC)
"The caretaker first asks the originator for a memento object."
This is not in accordance with the given code. There the caretaker is passive. It's the controller (main()) that asks the originator for a memento object and hands it over to the caretaker which only acts as a storage. Md2perpe 20:03, 20 September 2006 (UTC)
I think it is ridiculous to post the same (long) code example in two, basically identical languages as C# and Java. One of them should be removed. I don't give preference to any of them, so I'm removing the longer one. --Zigmar 14:33, 31 October 2006 (UTC)
Now the examples are in ActionScript 3, Java, and Ruby. At least one of these should be removed; ideally, only one would be kept, and in the most commonly used language of the three. Dhasenan (talk) 19:18, 21 May 2009 (UTC)
Is every trivial thing now a design pattern? Encapsulating the state of an object into a different object is pretty redundant because an object is defined as its own state plus methods (which are the class’ properties).—☠☢☣[d] 00:02, 6 August 2013 (UTC)
Classic examples of the memento pattern include the seed of a pseudorandom number generator [...] Someone please clarify how the memento pattern is used in this case. Thanks, --Abdull (talk) 21:34, 27 October 2008 (UTC)
question on style
The memento is marked as public static nested inner class. Its enclosing class is package scoped. Do you think that should be improved? Kind regards.