On Tue, 22 May 2001 07:39:47 -0700
Tom Bradford <[EMAIL PROTECTED]> wrote:

> 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?  

Exactly.

> 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.

Yup, this sounds reasonable to me. What do others think?

Lars
--
______________________________________________________________________
Lars Martin                                    mailto:[EMAIL PROTECTED]
SMB GmbH                                        http://www.smb-tec.com


----------------------------------------------------------------------
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