An application uses several type of data coded as objects. These objects require to be persistent, and the storage back-end may change (file system, sqlite, nedb are likely options).
What are the best way to design the related code to minimize the hassle to change storage ? A specific Store object to which I would pass my objects ? Have my objects inherit from on that does the storage ? Should my object "self-store" or not ?
For information, the practical case is for a local webapp using node-webkit (javascript) but the answer should probably not be language dependent, as long as it is object oriented.
Aucun commentaire:
Enregistrer un commentaire