Monday, June 1, 2015

Collections vs Iterables: Java


One important note while considering Collections vs Iterables is that Collections in some sense assume that you have loaded the data into memory and have access to the size(). On the other hand, Iterables allow for lazy evaluation of the data. This becomes an important considerable when you are working with large scale data just being loaded from a database. In a sense, it allows you “stream” the data.


Here is another good discussion:
http://stackoverflow.com/questions/1159797/when-should-i-use-iterable-vs-collection-in-java
  

No comments:

Post a Comment