How can I implement persistent storage for packages/applications? For example, how can my package have settings which persist across sessions?
I have implemented this more than once in the past. This question is to share our solutions and keep them for future reference. This the kind of application where reliability is paramount because it is often used in packages that may be distributed to many people.
Things to pay attention to:
Compatibility with different Mathematica versions. This is a typical requirement for packages. Solutions must be compatible with 10.0 and all later versions. Earlier version compatibility is even better, but I'm not asking for it because associations are too convenient ...
Persistent storage is useful for package settings. Solutions presented here shouldn't stand in the way of changing the settings format in future versions of the package (adding or removing settings, changing the format, etc.)
Corrupted storage files must be handled gracefully.
Given that this is meant to be included in other packages, simple and short solutions are preferred.
Anything else I didn't think of?