Object Serialization and saveProjectData - Opinions and ideas.

Ok, so I’m thinking about some of the things that I want to do in the long term and one of them is object storage.

Basically the ability to store and retrieve large amounts of data (such as level structures,etc…)

Do we have any benchmarks in regards to volume in terms of storage and retrieval speed with saveProjectData?

Because saveProjectData works on a key/string data mechanism, I could, for example write a method into my class
To serialize all the data members into one long, delimited string, and then to provide a constructor or other internal function that would take that string, parse it, and restore-rebuild the internal data values.

A connection to a relational database would be awesome, but there are other ways, of course performance is always the issue.

I am just starting this thread to collect ideas from fellow codea users on what they are doing to save and retrieve data in bulk.

Looking forward to your feedback.

Cheers,

Chris

Found this - http://lua-users.org/wiki/DatabaseAccess

Not sure if IO restrictions in Codea throws a wrench in the works though.

I suspect the save/loadProjectData will be close to instantaneous - even a large amount of data isn’t that large, comparatively. The big issue I’ve had with persistent project data is that it’s not binary - so you need to marshall a binary data structure to ASCII text (increasing it’s size), and then unmarshall it when you load it back. Not a giant issue, but annoying.

There is no socket or file access (by design - Apple is kinda tight on some things) - so yeah, most of that is probably a no-go without TLL embedding it…

Having said that, I’d love to see SQLite ( http://www.sqlite.org/ ) embedded - it’s public domain, so the licensing issues should be nonexistent, and Apple shouldn’t blink an eye. Plus, it can do binary blobs, so that whole thing goes away as an issue.

techBasic has file IO inside the sandbox. I’d really like the equivalent of the basic Python style redline and split functions, so the tstudents don’t have to write their own or import functions etc… For that matter, I’d love to see a version of Codea for Python!

While it’s certainly possible to serialized table/object structures as strings and store them using the current simple data save commands, it sure is ugly.