Re: Patterns for large resultsets of repositories - ideas?

Tom Eugelink <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
If the contract between the repository and the domain states that the obtained resource should be closed, than that is not leaking outside information into the domain. It would be if you would expose the used JDBC resultset or JPA query or whatever directly.

Solutions have to remain realistic; so if you need some kind of iterator over a resource that is closed after use, then it will be hard to work around that. If it were easily possible, we would not be using iterators-that-require-close-after-use in the first place. As long as the implementation is hidden in the repository an AutoClosable (http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html) iterator should conceptually be just fine. IMHO.

Tom




------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.