reset password
Author Message
ummata
Posts: 68
Posted 18:01 Oct 16, 2012 |

Hello all,

Set is for unique objects, list doesn't care about that.
Does it really matter for homework 3?

I see some fields in CSNS2 are lists even though they might store unique objects.
What are the benefit of using list in that case?

cysun
Posts: 2935
Posted 20:33 Oct 16, 2012 |

Objects in a set do not have an order, so when you display some data on a page, every time a user refreshes the page, the order of the data shown on the page may change, which is kind of annoying. You could use a SortedSet or a JavaScript library (like jQuery Tablesorter used in CSNS2) to sort the data, but sometimes it's just easier to retrieve the data from the database as a list using either @OrderBy or @OrderColumn.