Where is the proper place to put code that saves objects to
sharedpreference file
I guess this is a fairly generic object oriented question, but I am coming
to the conclusion that I don't think enough in terms of objects.
I have two classes, a Person class and a People class. I will be reading
and writing these (from and to the sharedPerferencesFile) from several
activities. Right now I have a PersistData class that handles reading and
writing. When I want to read or write these guys I get an instance of the
PersistData class and then call methods like, persistData.write(person);
or persistData.write(people); Is this a good way to do this, or should I
move the read and write code into the Person and People class?
No comments:
Post a Comment