The problem with this approach is that you have now created a Resource that
cannot be used in other situations where implementors of the Resource
interface can such as

storeResource(Resource res)
          Stores the provided resource into the database.

in the Collection interface, since it makes little sense for a native XML
database to know how to persist a boolean or a floating point number.

--
THINGS TO DO IF I BECOME AN EVIL OVERLORD #59
I will never build a sentient computer smarter than I am.

----- Original Message -----
From: "Jonathan Borden" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 2:25 PM
Subject: Re: Problems With Implementing XMLDB API


> Dare Obasanjo wrote:
>
> >
> > From the point of view of an implementor the XPathService returns
> Resources
> > within ResourceSets and this is way too coarse grained. In fact I feel the
> > concept of making ResourceSets the return value of XPath queries is a bad
> idea
> > for a few reasons
> >
> > 1.) It is inconsistent with standard XPath.
> > 2.) It is confusing to novice developers.
> > 3.) Very rarely is a user simply interested in just the documents that
> match
> > the query but in the actual nodes even for queries that return node lists.
>
> There is no reason that a "Resource" need be equated with a "Document", so I
> disagree with the point about this being too 'coarse grained'.
>
> But you bring up a good point that the result set of an XPath query need not
> always be XML.
>
> A solution to this issue might be to define a 'simple type' Resource (this
> is along the lines of how the DOM defines nodes with a type flag) e.g.
> something like the interface
>
> interface SimpleTypeResource extends Resource {
>     const STRING_TYPE = 1;
>     const INTEGER_TYPE = 2;
>     const FLOAT_TYPE = 3;
>     const DATE_TYPE = 4;
>     int getType();
>     String getString();
>     void setString();
>     Integer getInteger() throws cast...
>     Date getDate();
>     ...
> }
>
> This interface would roughly encapsulate the XML Scheme predefined simple
> types.
>
> When an XPath query returns a ResourceSet, one could inspect each of the
> resources to see whether they are an XMLResource, BinaryResource, or
> SimpleTypeResource.
>
>
> Jonathan
>
> ----------------------------------------------------------------------
> Post a message:         mailto:[EMAIL PROTECTED]
> Unsubscribe:            mailto:[EMAIL PROTECTED]
> Contact administrator:  mailto:[EMAIL PROTECTED]
> Read archived messages: http://archive.xmldb.org/
> ----------------------------------------------------------------------


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

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