I'm making a game for a class project, and the professor said that he wanted us to implement some form of functionality to save the game state, and that I should be able to plug in any "type" of saving as desired -- be it using serialized objects, xml, database, etc... It was suggested to have a master interface and have several implementing classes that save using their respective method... but I'm not sure how to actually approach this.
For one, I'm confused about which classes will implement this interface. Will it be all my objects? Or will it be the classes whose job it is to save the data? Should each object be responsible for saving its own data, or will one master class be responsible for saving the data of all objects? Should I probably use an abstract class instead? Also, it seems to me that each of my objects will have to implement Serializable
just in case such a method is used, even if it won't be...
I don't need help with code so much as I need help understanding the structure of this setup that will work best. I need to make sure everything is as modular as possible, as this is a project where I have to apply the many principles of software engineering to make "great software"...