collection vs list vs arrays as return type for EJB method

Viewed 8886

I was recently told that collection should be preferred to List as the return value of an EJB method. The argument is that in general collection is more generic i.e. gives you to change the underlying data structure without impacting the clients. And if this is the flexibility you want to have as a designer then using collection will make better sense. But then wouldn't it make more sense to return just an array instead of collection?

And what are performance impacts if any?

Thanks in advance.

4 Answers
Related