Is there any advantage or where returning a iterator is more desirable that a collection in methods for data access layer?
I´ve seen it somewhere, and don´t remember why.
P.S: Maybe it has to do with realtime fetching of some data while is not complete
A JDBC ResultSet
basically works like that, though it's a different and more complex interface. And yes, the reason for that is that it allows processing huge datasets without first fetching them entirely into memory.
Also, some other languages (C++ and Python, I belive) idiomatically use iterators as data items to be passed around. In Java, this is generally not done and should be avoided (unless there is a compelling reason) because Java's iterators lack some important functionality that makes them much less useful than a Collection - namely, you cannot copy them or reset their position.