148
Designing XML Based Applications
The developer may have to use the application's data model to create a set of
matching schemas, which would then be exposed as part of the application's inter
face. This third approach is often used when existing or legacy applications need
to expose an XML based interface to facilitate a loosely coupled integration in a
broader enterprise system. This technique is also known as legacy adapters or
wrappers. In these cases, the application's implementation determines the inter
face and the schemas to expose. In addition, this approach can be combined with
the meet in the middle approach to provide a proper adaptation layer, which in
turn makes available a more interoperable interface that is, an interface that is not
so tightly bound to the legacy application. See Chapter 6 for more information on
application integration.
4.3.4.2
Flexible Mapping
In complement to these approaches, it is possible to map complete documents or
map just portions of documents. Rather than a centralized design for mapping from
an external schema to a well defined internal schema, developers can use a decen
tralized design where components map specific portions of a document to an ade
quate per component internal representation. Different components may require
different representations of the XML documents they consume or produce. Such a
decentralized design allows for flexible mapping where:
A component may not need to know the complete XML document. A compo
nent may be coded against just a fragment of the overall document schema.
The document itself may be the persistent core representation of the data mod
el. Each component maps only portions of the document to transient represen
tation in order to apply their respective logic and then modifies the document
accordingly.
Even if the processing model is globally document centric (see Choosing Pro
cessing Models on page 151), each component can if adequate locally im
plement a more object centric processing model by mapping portions of the
document to domain specific objects.
Each component can handle the document using the most effective or suitable
XML processing technique. (See Choosing an XML Processing Program
ming Model on page 164.)
New Page 1