> > I think that getContent() and setContent() should be
> > removed from Resource all together and have
> > String getContentAsString() (or getContentAsText() if that name is
> > preferred) in XMLResource and
> > byte[] getContent() (or getContentAsByteArray() whatever is
> preferred) for BinaryResource.
> >
>
> Do you think we can cut down enough on the confusion by simply adding
> the getContentAsText method in addition to getContent?

My problem is that there is no contract that makes you sure you will get a
String back from a XMLResource -just a custom or whatever it should be
called. If we add a getContentAsText then when would you use getContent?

Would you work with a resource object on the Resource level getting content
out of it without knowing what actual resource it is? e.g. do you do things
like:

if (resource instanceof XMLResource)
        String bla = (String)getObject();

If not then I think get and setContent should be moved down a level from
Resource to XMLResource and Binary Resource and have the return and
parameter types changed.

Best regards,
Per




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