154
Designing XML Based Applications
Account Processing
Workflow
XML
Credit Card
Dispatching
Document
Processing
Logic
Airline Reservation
Processing
Figure 4.9
Fragmenting an Incoming XML Document for a Travel Service
E
Rather than pass the entire document to different components handling various
stages of the business process, it's best if the processing logic breaks the doc
ument into fragments and passes only the required fragments to other compo
nents or services that implement portions of the business process logic.
Figure 4.9 shows how the processing layer might process an XML document
representing an incoming purchase order for a travel agency Web service. The
document contains details such as account information, credit card data, travel
destinations, dates, and so forth. The business logic involves verifying the
account, authorizing the credit card, and filling the airline and hotel portions of the
purchase order. It is not necessary to pass all the document details to a business
process stage that is only performing one piece of the business process, such as
account verification. Passing the entire XML document to all stages of the busi
ness process results in unnecessary information flows and extra processing. It is
more efficient to extract the logical fragments account fragment, credit card
New Page 1