• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

XML vs Value Beans?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been thinking about using XML to pass data structures between method calls/processes instead of the traditional 'value beans' (JavaBeans with just private properties and get/set methods). I use a strict MVC architecture to keep the UI, business logic, and connector code separate. Has anyone seen any good examples or code for doing this?
Bill Hines
Hershey Foods
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general XML only makes sense for transfers between different systems or media. Using XML for internal interfaces could incur quite a large performance hit for encoding/decoding. If you have enough shared context to pass in-memory beans (or any other Java objects) directly, then you should carry on doing that.
If you already have to serialize your beans to get them between VMs or between machines, then the case is a lot less clear cut. Using beans is probably faster, using XML is probably more flexible in terms of plugging in non-Java components to your system.
Look at one of the many XML-RPC proposals (SOAP, SML-RPC etc.) for examples of passing simple data types. Any search engine should be able to find references.
 
Bill Hines
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Frank. That was my suspicion, possible performance hit, but I wasn't sure. It would be good to have these structures defined in XML, but I won't proceed at that cost. In-memory (value) beans will suffice for now, as our interfaces are internal. I'm interested in web services, and see some very cool stuff out on www.xmethods.com using UDDI and SOAP.
P.S. What's with this 'greenhorn' label on me? I'm certified! I guess there can be only one sheriff in town, haha. Thanks for the help Clint!
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"greenhorn" only means that you have posted less than 32 messages so far. Once you reach 32 you are automatically promoted to "Ranch Hand" to show you are familiar with using the Big Moose Saloon. Promotion to "Bartender" requires that you calmly and knowledgeably reply to a lot of peoples questions, and also that you are recommended by at least two existing bartenders or sheriffs. Promotion to Sheriff is done only in very special cases.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!