ethnarch wrote:
I use sets whenever appropriate. If I want unique values only for instance. It also has a small footprint then a list. As in any language you shouldn't be using something just because it's easy to use, but because it fits the situation that it's in.
Why not use a Set?
Actually I use a set, because I think it's the appropriate semantic to use in my situation (duplicates shouldn't be allowed), but what can I do if the front-end don't have any use for a Set? So what I did is I converted all my collection mappings to a list.
I just wonder about those who use Set, how do they display it on a JSF dataTable with minimal effort. Some have made a facelets tag function that converts Set to a List, but I wonder what could be the impact on it on the model if say, the dataTable displays editable rows (each row has an h:inputText), would the values entered be propagated back to each items if in case a user modified something on the table?