Hi there,
I've been using bags for a while, but recently I make use of sets. I've seen some differences but I really would like to hear the advice from an expert: which one is best, bag or set? performance, scalability, etc.?
I know that when using sets I must implement equals and hashcode, which leads to the "object id vs business key" problem (
https://www.hibernate.org/109.html). Also, I read that I must use sets in nhibernate.
Reagarding bags, I've read that when I add or remove an item from the bag, the entire collection should be deleted/reinserted :S
What is the truth? what are today's best practices about it? I've search over different forums but I just found advices from newbies like me :S (no offense guys) and or very old posts.
Is there any expert that can share us his/her fresh-knowledge about this? which one is the best? performance? db hits? scalability?
Thank you!