On Thursday, August 2, 2001, at 01:05 AM, Jeremias Maerki wrote:


As the new return type for the XPathQueryService.query() method I'm
considering adding a ResourceSet. This has been requested by several
people to have more flexibility in handling the results. This would be
part of the base package.

    interface ResourceSet {
       ResourceIterator getIterator() raises (XMLDBException);
       Resource getResource(in long index) raises (XMLDBException);
       long getSize() raises (XMLDBException);
       void addResource(in Resource res) raises (XMLDBException);
       void clear() raises (XMLDBException);
       void removeResource(in Resource res) raises (XMLDBException);
    }

Yes, why not? As long as the ResourceIterator still provides the possibility to retrieve Resources before the whole resultset has been transferred to the client. I think the methods "getRecource", "getSize" etc. will have to block until all results have been transferred. Right?


Hmm, that is an interesting point. The iterator approach is cleaner in this regard. Regardless this is something that will vary significantly across implementations in that some will stream some will chunk and some won't do anything. Maybe the guidance is something like.


In implementations that do not send the entire query result in one operation getResource MAY block until the requested resource is available.

In implementations that do not send the entire query result in one operation calling getSize MAY block until all query results have been transferred.

A cool side effect of this will be that listResources() in Collection
will then probably return a ResourceSet, too, so I will have a
ResourceIterator there.

I still think listResources should return an array of strings. There are a lot of times where you just need a list of IDs and not all the actual resources. An example is any kind of content browser. Using a ResourceSet would be very inefficient. Overall, it seems to me that wanting to retrieve all resources in the collection will be a pretty rare operation and is covered well enough with listResources. What are the solid use cases that would justify adding a new ResourceSet getResources() method in addition to listResources?



Jeremias Märki


mailto:[EMAIL PROTECTED]

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch

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


Kimbro Staken The dbXML Project htttp://www.dbxml.org ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact administrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------

Reply via email to