• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML vs Value Objects

 
Pappu Kumar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which would perform better....returning data as XML or as a JavaBean ?
What are the pros and cons of using either technique.
Please suggest
 
Peter Storch
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Performs better: JavaBean. You don't have to serialize/ deserialize the Java datatypes to xml.
This is alwas the prefered way if you communicate java to java.
If you have a communication between java and e.g. VB than XML might be an option (see WebServices), but consider CORBA too.
XML between java environments might be an option if you really need decouple the service from it's consumers, or if you anyway need to transform it into XML for later XSL transformations.
So no clear answer, it depends on what you intend to do.
 
sandy comp
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your application is restricted to single JVM, then Beans are the best option but if its distributed go for XML. Then u can expose u service to whole world....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!