This would greatly depend on Data Model demands of your application. OCCT comes with:
BinToolsandBRepToolsimplementing persistence forTopoDS_Shape(without any extra data), e.g. for saving shapes in files.- OCAF defines fundamental bricks for implementing your own Data Model with
TopoDS_Shapepersistence with arbitrary attributes and other data. It also defines low-level Undo/Redo mechanisms. XCAFdefines document structure based on OCAF for Data Exchange - e.g. shapes with colors, materials, validation properties, PMI, metadata. Mostly fllfills capacities of STEP standard, but includes some other features. It is possible extending XCAF document at application level, but this customization should be done carefully.TObjdefines object-oriented tools on top ofOCAFfor implementing application-specific Data Model with shapes, Undo/Redo, persistence. It provides a more clear and straightforward mechanism than using low-levelOCAFbricks directly.
As such, you need first to understand which information you would like to store in your document, how many application-specific attributes and data it will hold and which operations should support.
E.g., if Data Exchange is your main focus, than XCAF is preferable document format compatible with all XDE interfaces in OCCT (STEP, IGES, OBJ, glTF, VRML) and having it's own persistence (binary XBF or textual XML). But it is not that extensible and might be difficult to modify.
If you have a lot of own data objects or completely different document structure - then it might be better starting with TObj (it is quite convenient interface, but you might experience some lack of live examples and tutorials - I've been working with it having a look at existing projects using TObj, a great cheat sheet of good practices). Dealing with low-level OCAF might be even more challenging for newcomer (but I have no personal experience on that).
Of course, you may end up implementing you own Data Model and rely on BinTools and BRepTools just for file persistence of TopoDS_Shape - this is what FreeCAD developers decided to do (with own XML file format), as far as I understand. But in this case you will have to implement Undo/Redo/Transactions mechanism on your own (if your application requires that).