posted 14 years ago
Hi,
When defining collections, I've seen some developers prefer to use java.util.Collection, whilst others prefer more specialized types such as java.util.List and java.util.Set. When we use java.util.Collection, Hibernate uses PersistentBag as the implementation class, where as for List and Set, it uses PersistentList, PersistentSet respectively.
In my perspective, I think it's better to use types such as List / Set, because they define certain qualities such as guaranteed ordering, non-duplication, etc (Unless we need to have a Bag).
What do you guys think about this?