On Thu, 07 Jun 2001 11:38:08 -0400
Kimbro Staken <[EMAIL PROTECTED]> wrote:

> > org.xmldb.api.base.Resource has a method getContent() that returns an
> > Object. which I take to describe a very abstract behaviour for data
> > manipulation, so far so good.
> > 
> > In org.xmldb.api.modules.XMLResource there is getContent, getContentAsDOM
> > and getContentAsSAX but there seem to be the expectation that getContent
> > here should in fact return a String.
> > 
> > I went with storing Node's in the implementation of XMLResource so my
> > "native format" is Node and not String as in the reference implementation,
> > hence it would be natural for me to return the Node object for getContent
> > instead of converting it to a String.
> > 
> > What I'm suggesting is that there is an additional method added to
> > XMLResource called getContentAsString() or possibly getContentAsText() that
> > would match the content retrievers for DOM and SAX and make things very
> > clear.
> 
> The idea with getContent was to make it possible to work with the
> default representation of multiple resource types without calling a
> special method. For XMLResource the default behaviour for getContent is
> to always return a string. 
> 
> Are you suggesting getContentAsText() should be in addition to
> getContent() or should replace it? I agree it would be clearer in the
> XMLResource context but I like the idea of as long as you have a
> Resource you can call getContent to get the default representation. 
> 
> Anyone else have any thoughts on this?

Agreed. As long as the API makes clear what the default behaviour of
a particular Resource really is - e.g. String for XMLResource - then
this is (getContent) a good choice for me. On the other hand I see
the advantage of XMLResource.getContentAsText() but then the Resource
interface is obsolete except for the common super class/interface of
all possible implementations. But does an "empty" interfaces really
make sense?

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