samedi 7 juillet 2018

How to push the UI re-ordering of a sequence to back-end such that the order of sequence is preserved in database layer as well

Example :

At UI layer , users are shown a list of books in particular order in which they want to read.

1 . In Search of Lost Time by Marcel Proust
2 . Don Quixote by Miguel de Cervantes
3 . Ulysses by James Joyce
4 . The Great Gatsby by F. Scott Fitzgerald

....

Problem statement : Now users can re-order the books in UI any number of times.Lets say the new list in UI looks like below after the user's re-ordering.

4 . The Great Gatsby by F. Scott Fitzgerald
2 . Don Quixote by Miguel de Cervantes
1 . In Search of Lost Time by Marcel Proust
3 . Ulysses by James Joyce

How could the sequence change be optimally updated in database ? (Note there can 100 of records that can shown in UI and number of changes allowed are not limited.)

Aucun commentaire:

Enregistrer un commentaire