On 4/26/13 11:17 AM, Gregory Szorc wrote:

But, please don't
make consumers worry about things like SQL, schema design, and PRAGMA
statements.

Ideally, yes. But I suspect there will never be a one-size-fits all solution, and so we should probably be clear about what it's appropriate/intended for (see: prefs today!).

Anyway, I just wanted to see if others have thought about this. Do
others feel it is a concern? If so, can we formulate a plan to address
it? Who would own this?

I'd really like to see a simple, standard way to mirror a JS object to/from disk. There would barely be any API, it Just Works. EG, something like:

  Cu.import("jsonator2000.jsm");
  jsonator.init("myfile.json", onready);
  var o;
  function onready(aVerySpecialProxyObject) {
    o = aVerySpecialProxyObject;
  }
  ...
  o.foo = 42;
  if (o.flagFromLastSession) { ... }

With a backend that takes care of file creation, error handling, flushing to disk, doing writes OMT/async, handling writes-on-shutdown, etc. Maybe toss in optional compression, checksumming, or other goodies.

It's been on my maybe-some-weekend list for a while. :)

Justin
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to