|WikiProject Computer science||(Rated Start-class, Low-importance)|
|WikiProject Java||(Rated Start-class, Low-importance)|
Also, did someone seriously state on here that C# and Java are "identical languages"? I'm not starting a flame war, but I know both well and they are so fundamentally different that to even suggest that is absurd. Learn more about the history and modifications of the language over the years it has been around and the differences become extreme from that of Java (btw, C# is a mix of Java and C++, however no one compares C# to C++) or just visit this site http://rapidapplicationdevelopment.blogspot.com/2013/10/c-isnt-java-learning-via-katas-part-1.html. Having the Java example stay and the C# example go is baseless (i.e. there is no evidence of superiority of either language neither in usage statistics nor in functionality, they are two completely different languages if you actually know them, and the only reason for C# example to go seems to be because the Java code was written first before the C# code was - which is not a strong reason). — Preceding unsigned comment added by 184.108.40.206 (talk) 17:53, 1 December 2014 (UTC)
Why not just fix the C# example with someone who actually knows C#. That seems like a better solution then just getting rid of it. I helped fix it, but in general it is not functionally equivalent to the Java code. — Preceding unsigned comment added by 220.127.116.11 (talk) 17:43, 1 December 2014 (UTC)
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. 18.104.22.168 (talk) 01:50, 21 March 2008 (UTC)
I would use Vector instead of ArrayList in CareTaker, because ArrayList does not take care of sorting. 22.214.171.124 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)
- I was wondering the same thing. I couldn't find an explanation on GBooks, and a web search turns up websites that cite the Wikipedia for this example. QVVERTYVS (hm?) 08:08, 20 April 2015 (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.