I want to implement a kind of favorites list. Lets take a play list for this example:
Song A
Song D
Song B
Song C
The order of songs should be saved and the user should be able to rearrange this order and insert new elements at an arbitrary point in the list.
My idea is to use a field "position" and reset it for all elements of the list, when the list is saved. I think that is what Javas Hibernate does.
Another idea is to use position numbers with a big difference, say 1000, so that there is still room for modifications:
Song A 1000
Song D 2000
Song B 3000
Song C 4000
Song C will be inserted between A and D with position number 1500:
Song A 1000
Song C 1500
Song D 2000
Song B 3000
Any better ideas?