diff options
author | abcd <amos.choy@nokia.com> | 2012-05-30 17:56:31 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-06 11:19:22 +0200 |
commit | 8568f4add64e070667e8255bb7b113d9e935e407 (patch) | |
tree | e9668891206105845cb2763ce501cab51979ee1c /tests | |
parent | 9747a86b53d09f6f659e92adeb99a4e44211e960 (diff) | |
download | qtlocation-8568f4add64e070667e8255bb7b113d9e935e407.tar.gz |
Refactor schema representation of categories
The old schema was fragile due to the fact
that there was dupliation of reference data.
E.g. if A->B->C ('->' means parent of)
then C would have a "linage" consisting
of [A,B,C], in addition to a parentUuid of B
Likewise, B has a lineage of [A,B] and
a parentUuid of A.
When assinging a category to a place the lineages
of the categories would be combined into an
allCategoryUuids field, eg a place belonging to C
would have allCategoryUuids consist of [A,B,C].
The idea being that if we are searching by category A,
then one could look whether a Place's allCategoryUUids
field contains A.
This duplication of data introduces complexity making
maintenance of data integrity more difficult.
Instead Categories only reference their parents,
and Places only reference categories they are directly
assigned to.
If someome were to search for category A, we would traverse
through the "cached" categories of the engine to get A and
all of its subcategories, then search if the place
categoryUuids field contained A or any of its subcategory
ids.
The cost of this approach is that the "cached"
categories must always be up to date. We listen
to any saved/removed category notifications and
re-initialize the categories. There is a small window
of opportunity between a save and update of the "cache"
where the "cache" is incorrect.
Change-Id: I841c86b91c274573a84c7c761f2105e3d1851498
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions