• Fake functions?? No getNth??

    By Carl Duranleau 1 decade ago

    Hi, I'm in a domino project that needs to be optimized as mush as possible. After a little search on the net, I saw the OpenNTF Domino API. Since I have to optimized a DocumentCollection sorting, I was happy to see a "toArray" function in the DocumentCollection API page. So I decided to convert my project to OpenNTF. After some adjustments, I was able to compile with the new API. It was fine until I saw an UnsupportedOperationException exception for the toArray function and a NthDocumentMethodNotPermittedException exception for the getNthDocument!!!! The API says that there's a function that convert a DocumentCollection to an array, but it's a fake! In my project, I'm handling document list paging by using a getNthDocument to set the first pointer in a collection, and getNextDocument to get the documents. Now, how am I supposed to get the first document of a page in a collection with no getNthDocument!? Do you really this doing a getFirst and many getNext until I get my first document is efficient!?

    After getting the source code from github, I saw that even with a real toArray function, I wasn't going to get more speed since it's only a wrapper over the slow Domino API. So I'm gonna get this API out my project and get back to work with the old stuff.

     

    1- Update your API reference guide correctly and don't put unavailable methods in it.

    2- Every Notes developer know that getNthDocument in a loop is inefficient, but don't try to give lessons to other developers with your code. You'll never be able to catch all cases.

     

    Have a nice day,

     

    Carl