Home  /  Questions  /  Question

50   50
Sep 21, 2010

dofactory GOF memento pattern flawed

The dofactory implementation of the GOF memento pattern breaks encapsulation. The contents of the memento can be viewed by the caretaker. No reply to an email sent to dofactory.

830   99.9
Sep 22, 2010

Yes, I remember your email.  There was no reply because from your email we gathered that you seem to extract great pleasure in pointing out other developer's 'flaws' and failure to perform proper unit testing.  Unless you want an open discussion in which we can all learn and grow, I suggest that you implement the most perfect memento pattern in your own work and leave it at that.

50   50
Oct 21, 2010
The definition of the memento pattern, from your own Design Pattern Framework document (page 67), starts with "Without violating encapsulation". This is not a minor issue but the major reason for the existance of the memento patter. The failure of your implementation to meet this requirement followed by your very rude and unprofessional response raises serious concerns about dofactory.

377   99.9
Dec 28, 2010
Can't this be done using private setter and passing memento object in caretaker constructor?