150
Designing XML Based Applications
on page 131.) For example, suppose your application works with an
Address
entity
bean whose instances are initialized with information retrieved from various XML
documents, such as purchase order and invoice documents. Although the XML doc
uments conform to different schemas, you want to use the same component the
same
Address
bean without modification regardless of the underlying supported
schema.
A good way to address this issue is to design a generic XML schema into
which your component state can be serialized. From this generic schema, you can
generate XML serializable domain specific or content objects that handle the seri
alization of your component state.
EntityBean
AddressBean
XMLSerializable
Address
EntityBean
PurchaseOrderBean
<>
Address.xsd
XMLSerializable
PurchaseOrder
EntityBean
LineItemBean
<>
PurchaseOrder.xsd
XMLSerializable
LineItem
<>
LineItem.xsd
Figure 4.8
Composite XML Serializable Component
New Page 1