Custom Persistence Help Required

Hello,

 

In sample project about Custom Persistence there exists two interfaces namely, ModelFactory and SModelPersistence overwritten by XmlModelPersistence class. If we are interested in using our own persistence model should we change the @Override parts of this class and leave the rest untouched? If so, how do we implement the:

SModel load()

SModel create()

boolean canCreate()

void save()

boolean needsUpgrade()

void upgrade()

boolean isBinary()

String getFileExtension()

String getFormatTitle()

SModelData createEmpty()

SModelData readModel()

void writeModel()

functions so that our models persists in our own custom format. I read the code and the comments yet did not understand what should I implement in these methods. I already read the Custom-Persistence-Cookbook too. If you used this facility can you elaborate more on the logic behind this interface. What is the use of XMLConverter class which does not implement any interface or extend any class? If my format is not XML do I still need it? How do I implement a per-root persistence as Universal-XML-based-file-per-root format does?

 

Where can I see the inner implementation of this Universal XML-based file-per-root format?

Please sign in to leave a comment.