[Qt-qml] QtJsonDb QML API review
jamey.hicks at nokia.com
jamey.hicks at nokia.com
Tue Nov 22 13:53:26 CET 2011
On Nov 21, 2011, at 6:38 PM, ext Alan Alpert wrote:
> On Wed, 16 Nov 2011 22:33:15 ext denis.dzyubenko at nokia.com wrote:
>> Hi guys,
>>
>> Here in QtJsonDb project we want to improve our existing QML api and hence
>> ask for a review of our api proposal.
>>
>> The documentation can be found here:
>> http://chaos.troll.no/~denis/qtjsondb-qml-api
>
> There are some little things I noticed, but without overview docs it's hard to
> understand the real purpose of the API and so difficult to review it at a high
> level.
>
>
> I don't understand why you have to have a separate model for sorting instead
> of having a sort command in the query (like in SQL). Surely the data store is
> more suited for that? And then you won't need the confusing problem of two
> ListViews, one that can sort and one that can incrementally fetch data (you
> could just have one super-view).
We designed JsonDb with restricted memory devices. One of our strategies is to minimize the amount of memory required by daemons so that applications have more memory available. Sorting objects in the daemon takes memory proportional to the number of items matching the query, even if fewer items are requested. We decided to make the design decision that any application that needs to dynamically sort a query response does so in the application process, so that the amount of memory needed in the daemon is minimized.
There is no point incrementally fetching data if the daemon had to fetch all the objects into memory to sort them. For apps that prefer to display data as soon as possible, the SortingListModel enables them to start displaying as soon as first responses are received and to fill out the display as the rest of the responses are received.
This illustrates another aspect of the design, which is to put control for these sorts of tradeoffs into the hands of the application developer.
>
>> Some sample qml files can be found here:
>> http://chaos.troll.no/~denis/qtjsondb-qml-api/simplelistmodel/simplelistmod
>> el.qml
>> http://chaos.troll.no/~denis/qtjsondb-qml-api/simplelistmodel/simplelistmo
>> del2.qml
>> http://chaos.troll.no/~denis/qtjsondb-qml-api/simplelistmodel/simplelistmo
>> del3.qml
>
> All three of these appear to be simple contact lists. I don't suppose you have
> any other example use-cases? Perhaps the SameGame high scores should be stored
> with JsonDb instead of SQL, or is it not entirely suitable for that use case?
We have a version of SameGame that uses JsonDb for high scores. I'll try to track it down.
Cheers,
Jamey Hicks
Distinguished Research Team Leader
Nokia Research Center, North America Lab, Cambridge US
More information about the Qt-qml
mailing list