Persistence In Delphi

Somebody said PersistenceInDelphi was tricky compared to other languages. They may be right.

Anyway, there is the open source Techinsite persistence framework that you could use. See http://www.techinsite.com.au

Or if you have $3000, there is Bold. See http://www.boldsoft.com

These are both big beasts. Bold is huge and does a lot more than just object persistence.

So what is it that Delphi is missing, that makes object persistence difficult?

Basically, creating a TPersistent and then making sure you cannot make it persistent (only TComponent can be used with a TStream). Stephan Eggermont


Basically, creating a TPersistent and then making sure you cannot make it persistent.

Stephen, You're assuming that everyone wants to persist stuff to a stream. What TPersistent does is two fold - it ensures that all Published declarations show up as RunTimeTypeInformation, and it introduces the Assign() method for assignment compatibility.

You can build everything else you need on top of that foundation. Yes, it would be nice if Delphi came with more predefined mechanisms, but I suspect that even then people would be asking for more. After all, if I remember correctly, CeeSharp has 7 (or is it 9?) distinct persistance mechanisms as standard.

If you haven't looked at it, look at the RTTI units that get installed with Delphi - they make it reasonably simple (well, not horrendously complicated) to write generic routines to load and save most any object, even those with cross references.

-- BevanArps


EditText of this page (last edited June 14, 2004) or FindPage with title or text search