Lars Martin wrote:
> > 2. It's not so easy to understand why Collection.getResources() returns
> > a String[] of IDs and XPathQueryService.query() returns a
> > ResourceIterator. In both cases it might be good to have both
> > possibilities, first to iterate through the resources and second to get
> > a list of resource IDs. My priority lies on the ResourceIterator.
> 
> I came across the same. I like the Iterator pattern but I don't know
> if it makes sense to return an iterator for each and every method.

One of the reasons I can see for 'not' returning a set of IDs from a
query is that the results may be synthetically generated, and might not
even have IDs.  Returning a set of IDs assumes that the query language
is producing a set of results that map to actual collection resources. 
But what if I executed a query that performed an XSLT transformation or
dynamically produced a document fragment that held the current time?  

Still, I see the value in having Collection return a ResourceIterator as
the set of IDs is likely to change, a ResourceIterator can give you a
more up-to-date snapshot of them as you're walking the list.

-- 
Tom Bradford --- The dbXML Project --- http://www.dbxml.org/
We store your XML data a hell of a lot better than /dev/null

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact adminstrator:   mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to