[Qt-qml] QtJsonDb QML API review
Alan Alpert
alan.alpert at nokia.com
Tue Nov 22 00:38:14 CET 2011
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.
Why QtAddon::JsonDb instead of QtJsonDb (for JsonDbConnection)?
Partition has properties with names starting in _. This usually implies
private members, and is confusing to see in public API. Is this a detail of
JsonDb schema that is not explained somewhere else?
We don't have a great solution for JS docs yet, but you can create 'fake'
element docs to represent JS objects with defined parameters. For example, you
could add a CreateResponse object with documented properties and refer to that
in the partition docs instead of having a bullet point list.
http://chaos.troll.no/~denis/qtjsondb-qml-api/qml-qtaddon-jsondb-
jsondbcomponent.html doesn't actually document anything...
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).
> 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 usecase?
--
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks
More information about the Qt-qml
mailing list