Suppose I have a program, with let’s say – a dictionary, that the user updates, changes and stuff like that. Now, I want to save that dictionary in a file, so in the next time he runs the program, he can continue where he stopped.
What is the right way to/how would you accomplish that?
Thank you.
One option could be to serialize the Dictionary object itself to a file, in either a custom format, XML, or simply a binary representation and then deserialize it when the application loads, but this breaks down with multiple users.
One of the most common approaches to persisting data is in a database.
Apologies if this answer is vague, but the solution really depends on the needs of your application. Maybe a simple text file is sufficient, or maybe you do need something more robust, such as a database.
There are several free database options out there: SQL Server Express, MySQL, PostgreSQL, SQLite just to name a few.