dev@jax-ws.java.net

Re: SourceMessage

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 04 Jan 2006 07:49:04 -0800

Kohsuke Kawaguchi wrote:

>
> Mostly to Vivek,
>
> Thanks for the SourceMessage class.
>
> I wonder if it makes more sense to actually have 3 kinds of Messages
> for Source --- one for SAXSource, another for StreamSource, and the
> other for DOMSource.
>
I tried doing that but preffered this approach as having a helper class
- SourceUtils that can be used by SourceMessage and SourceHeader that
composes with it.

> I think StreamSource can be turned into the current StreamMessage, and
> chances are DOMMessage and SAXMessage would look very different to
> each other that warrants a separate implementation.
>
Thats right. In the current approach thats what is done. For
StreamSource a StreamMessage is used.

> You can then have a factory method that does ugly "instanceof" 3 times
> to create the right instance.
>
Certainly this can be done.

> I think it makes the code easier to follow as well as faster.
>
Probably easier to read, but why do you think faster. There nothing that
the current SourceMessage does would be slower unless I am missing
something.

-vivek.

-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.