saving object data
Posted on 2000-02-26
Can anyone suggest a good method for the following?
I have several different classes, and numerous objects of each class stored in collections. I need a way to store the data in the objects to a file, and then to be able to restore them again.
Each class is just a bunch of public variables, I would make them types, but I need to be able to add them to collections.
Currently, my only idea is to create a type for each class containing the necessary variables, and having a method to put the class info into the type, then putting it to a file, and then having a method to get the type from the file, and put the variables back into the class. However, this seems like an ass-backwards approach, so I'm wondering if there's something I haven't considered yet.