Hi, I use the Memento Pattern to save properties of a multi-instance form, where n forms are created by user inside a parent form. The purpose of the memento is to regain the same number of forms, and their settings, when a user close and later reopen the parent form. The saving of the form mementos are done by a "save" button on the parent form. So I have two challenges..
- I need a default set of properties to use when opening a new form, so where do I set these default values.. In a default empty constructor of the memento, or somewhere (where?) in the Originator?
- Next I want the user to be able to change the defaults, hence to make their own default memento. How/where is this saved, and how do I determine if such default memento has been set or not?
Of course I could probably tweak this to work somehow, but I would like to know if there is a general pattern description that solves this, such that I have a firm guideline to follow.
cheers!