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

RE: Java and XML



Surely this does depend on what you are going to do with the data in your collection.  If all you are going to do is take the collection, convert it into xml then convert it back into another Java object, this seems wasteful.  However, I would not discount using XML in certain scenarios.

I've been using XML in both Java and VB scenarios since the MSXML 1.0 parser came out.  For VB developers MSXML is fast - very fast.  Many of the systems I've recently built rely upon a model where a service provides the gateway into the database.  It receives POST requests over HTTP and then serves up XML for the response.  Then in the Servlet world, I have a simple SAX filter that modifies this XML stream and sends it to Xalan to transform into HTML.  This works very well for me and the performance is quite acceptable (even on my pathetically slow test server).

Now with my XML server I can write other administrative applications or other services to push data into and get data out of this system without having to worry about compatibility with VB, C++, RMI, COM or whatever other binary standard is the flavor of the day.  It even makes it easier to move from one database platform to another.  In the heterogeneous computing world that I live in, it makes life a lot easier.  How many people out there have written a Java application that administers data stored in an MS Access database on a different server?

I should mention that I chose not to use EJB's for my projects, so my comments may be lacking some wisdom that that perspective may provide in this context.

Good Luck,

Jason

At 11:42 AM 2/19/2002, Westfall Chad wrote:
Not to shoot holes in your VB developers idea but if you do this, you would have to maintain a separate XML messaging layer.  This messaging layer would need to define all your parameters and will add considerable time to your project.  Not to mention the overhead of instantiating an XML object.  You also would not be able to generate appropriate Java Docs.  Your one parameter for every method would be a XML string or a XML DOM object.  In my opinion, I would not suggest this approach.  I'm telling you this based on my experience, I worked on a project that passed around a lot of XML.
 
Good Luck,
 
Chad Westfall

 -----Original Message-----
From: Kevin O'Neill Stoll [mailto:kevinostoll@yahoo.com]
Sent: Tuesday, February 19, 2002 10:42 AM
To: ajug-members@www.ajug.org
Subject: Java and XML
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