| Author |
xml vs DTO
|
ramesh kumaru
Greenhorn
Joined: Sep 30, 2012
Posts: 2
|
|
Hi All,
Why is xml used to pass data between application layers? We can very well use DTO for same purpose.
Thanks
Ramesh
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
Welcome to the Ranch, Ramesh!
As for your question: you would have to ask the person who decided to do it that way why they made that decision. It's possible that it was a good decision, or that it was a bad decision, but without any details it's useless to speculate about it.
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12325
|
|
My reasons for using XML instead of DTO etc
- easy to create/modify example data with a text editor so you can test data processing independently from data creation
... see for example the use of SOAPui to manipulate SOAP XML messages, especially for creating error conditions
- easy to read actual data transmissions - see SOAPui again
- easy to add new data elements without having to modify existing programming (assuming you chose a good structure in the first place.)
Bill
|
Java Resources at www.wbrogden.com
|
 |
ramesh kumaru
Greenhorn
Joined: Sep 30, 2012
Posts: 2
|
|
Thanks William and Paul,
In my application they have DTO and in each DTO they have marshalXML and unMarshalXML method/function which are used for xml generation.
This xml is passed to different layers including DAO layer. I am fail to understand why this architecture, instead they can use DTO itself and avoid overhead of Marshalling XML and UN-Marshalling XML.
Can you please provide some pointers, How this architecture benefits.
Regards,
Ramesh
|
 |
 |
|
|
subject: xml vs DTO
|
|
|