XML vs Value Beans?
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
Bill Hines
Hershey Foods
Bill Hines<BR>Hershey Foods
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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.
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
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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!
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!
Bill Hines<BR>Hershey Foods
posted 24 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
"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.
| Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |








