[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java and XML



I agree with Ron.  Returning a collection of objects
is going to be a lot faster than returning an XML
document.  If you return a collection, you can use the
Iterator interface to navigate through the collection.
 Same goes for passing in an xml document as a
parameter to a method call.  XML is nice for passing
information to external clients or maybe storing your
data in a config file, but using XML internally to
applications doesn't seem like a very good or
efficient way to do things.  


--- Ron Cordell <roncordell@attbi.com> wrote:
> On Tuesday 19 February 2002 10:41 am, Kevin O'Neill
> Stoll wrote:
> > Got a question about Java and XML:
> >
> >     Let's say you are interacting with some sort
> of Session bean and the
> > method you are going to access is going to return
> a collection. It seems to
> > me that you could do this just as easily by
> returning an XML string to the
> > client. The problem that I am having is that I
> can't find anyone who
> > supports this idea, via examples or in technical
> articles, so it makes me
> > wonder if I am wrong but I just don't know it yet
> :P
> >
> >
> >     As well, I spoke to a VB developer friend of
> mine and they use XML to
> > pass a method parameters. He said this was
> extremely useful because if he
> > wants to add a parameter to a public method that
> he does not have to break
> > his binary compatibility. Once again, this sounds
> great for Java but I have
> > not been able to find any examples in how-to's or
> technical articles.
> >
> >
> >     I'm interested in hearing some feedback on the
> up's and down's of using
> > XML to send parameters and return collections or
> lists. As well as, where I
> > might find some examples of how someone else has
> implemented it.
> >
> >
> > Thank you,
> >
> > Kevin O'Neill Stoll
> > http://kevinstoll.org/
> > (770) 569-7251
> 
> Wouldn't you have to instantiate an XML parser to
> then access the nodes that 
> you were interested in for the collection? Unless
> there was some specific 
> advantage to doing it with XML, why do it that way?
> 
> -ronc
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com