Kimbro Staken wrote:
>
> How about this.
>
> interface Resource {
> Collection getParentCollection();
> string getId();
> string getResourceType();
>
> void setContent(Object content);
> Object getContent();
> };
>
> interface XMLResource : Resource {
> // Default getContent/setContent from Resource returns text
>
> // DOM Support
> Node getContentAsDOM();
> void setContentAsDOM(Node content);
>
> // SAX Support
> void getContentAsSAX(in ContentHandler handler);
> ContentHandler setContentAsSAX();
> }
>
> interface BinaryResource : Resource {
> // Simply overrides getContent/setContent from Resource
> }
>
> This gets rid of the setting of ResourceType on collection which is the
> one thing that really bugged me about the current API. The database can
> determine the type of resource to return seamlessly and the client can
> just use it how it wants. Also if the database doesn't support either
> DOM or SAX the API on the client can always parse the text document
> easily into either format and communicate with the server in whatever
> format it expects.
I like this. It's very obvious and easy to use.
-- Ron
----------------------------------------------------------------------
Post a message: mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]
Contact adminstrator: mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------