hot info

Network Resources

on Selasa, 16 Juni 2009

Network Resources
People have concerns about how XML networking will perform once it is in widespread use, but XML networking brings big performance advantages in one area: Because it can contain arbitrarily complex structure, an XML document can batch up information and reduce the number of network transactions required. For example, a hypothetical accounting server with an XML networking interface might allow a client to request information about multiple accounts with a single XML document sent over HTTP, as in Listing 5-1.

Listing 5-1. XML Batch Request









The server could respond with all the information also in a single XML document, as in Listing 5-2.

Listing 5-2. XML Batch Response

account="assets.current.accounts-receivable">144298.00
account="assets.current.petty-cash">2119.16
account="liabilities.current.accounts-payable">89376.78
account="income.professional-services">2033945.39




In a non-XML system, the same information could require many request/response exchanges, and the extra latency would create major slowdowns for an application. More advanced distributed-computing protocols have mechanisms for batching information on the flycalled marshalingbut they are complex to implement and have proved less than impressive in the field. Perhaps XML's simple approach will turn out to be more robust and effective.

0 komentar:

Posting Komentar