W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 16 Aug 2009 10:28:20 +0000 (UTC)
To: Aaron Boodman <aa@google.com>
Cc: public-webapps WG <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.62.0908161027580.6420@hixie.dreamhostps.com>
On Wed, 12 Aug 2009, Aaron Boodman wrote:
> >> 
> >> I also don't see what not having a callback buys. I'm not sure if you
> >> noticed, but I was suggesting that the callback be reentrant. So if you
> >> do this:
> >>
> >> var theResult = null;
> >> database.syncTransaction(function(tx) {
> >>   theResult = tx.executeSQL("select * from ...").rows[0].val;
> >> });
> >> alert(theResult);
> >>
> >> It will do the right thing. Are you concerned that developers won't
> >> realize that the callback is reentrant and will invest more effort
> >> writing their code in an asynchronous style?
> >
> > The only reason for not using callbacks in the sync API was that callbacks
> > are harder to work with than the straight-forward imperative style.
> >
> > I can change the spec to a hybrid style with statements in the imperative
> > form but the transactions themselves using closures. Would that be ok?
> 
> Yes, that is what I was proposing.

Done.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 16 August 2009 10:29:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT