Re: Problems With Implementing XMLDB API

2002-01-12 Thread Dare Obasanjo
- Original Message -
From: "Jonathan Borden" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 3:05 PM
Subject: Re: Problems With Implementing XMLDB API



> Err, so "addResource" on a BinaryResource is OK _from an interface point of
> view_ when "addResource" on an integer doesn't make sense? Do you really
> mean this?

Considering that a number of native XML databases store BLOBS including Tamino
and eXcelon as well as the fact that a few XML-enabled databases support
storing XML as blobs such as DB2 (XMLCLOB type) and Oracle (in regular CLOBs)
I don't see why it should be unreasonable to expect an API that expects to be
used by XML databases not to support storing binary resources.

On the other hand expecting the database to expect to know how to manage
floating point numbers and booleans is ludicrous in my opinion.

> A collection/list/set of integers is a _perfectly_ reasonable and well
> understood entity.

Not for storing in a XML database.

> What makes this different then a collection that expects a list of XML
> documents each of which is valid to a particular schema, or a parent XML
> element into which you attempt to insert a child element that would make the
> XML invalid?

Because those are *validation* problems as opposed to *type* problems. In both
cases the database knows how to support the types but they happen to be
invalid in the case of booleans and integers they are not the correct type to
be handled by the database


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


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


Re: Problems With Implementing XMLDB API

2002-01-12 Thread Jonathan Borden
> >
> > so? you also cannot store a book where SQL expects an int.
> >
>
> Now I'm confused.
>
> What _good_ RDBMS API have you used that allows you to pass types that
aren't
> natively supported by the DB in update operations?

> Just to recap I'll rewrite
> the query that Kimbro agreed didn't make sense that you are now advocating
> should be a valid part of the API
>
>  String xpath = "count(/movie/title='Gladiator')";
>
>   XPathQueryService service =
>  (XPathQueryService) collection.getService("XPathQueryService",
"1.0");
>
>ResourceSet resultSet = service.query(xpath);
>
> ResourceIterator results = resultSet.getIterator();
>
> while (results.hasMoreResources()) {
>XPathResultResource resource =
>   (XPathResultResource) results.nextResource();
>
>  myCollection.addResource(resource);   /* THIS MAKES NO SENSE */
> }
>

Err, so "addResource" on a BinaryResource is OK _from an interface point of
view_ when "addResource" on an integer doesn't make sense? Do you really
mean this?

A collection/list/set of integers is a _perfectly_ reasonable and well
understood entity.

Either "myCollection" understands lists of integers or it doesn't. If it
understands lists of integers, then it is perfectly happy. If it doesn't
then the collection should complain that the the resource is not of the
proper _type_ to add to the collection. If you do not wish to allow the
elements of "myCollection" to be integers then you can _simply_ throw an
exception when you try to add the resource.

What makes this different then a collection that expects a list of XML
documents each of which is valid to a particular schema, or a parent XML
element into which you attempt to insert a child element that would make the
XML invalid?

Jonathan

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