Chapter 6
279
Example 6.5 shows the equivalent Java classes for the canonical model of invoice
information.
public class Invoice {
public string getInvoiceId();
public Address getOPCPoId();
public string getSupplierId();
public string getStatus();
// class implementation ...
}
Code Example 6.5
Java Class Equivalents for Canonical Invoice Information
Once the XML is defined, you can also use tools such as JAXB to generate the Java
classes. (See Flexible Mapping on page 148.)
After establishing a canonical data model, you must devise a strategy to
convert any alternate data representations to this model. Because it plugs its enter
prise systems billing, order processing, and CRM in via an application server,
the adventure builder enterprise exposes the canonical data model only through
the external interfaces exposed by the application server. That is, only those com
ponents with external interfaces Web service applications, remote enterprise
beans, and so forth expose the canonical data model. Since the external world
needs (and sees) only the canonical data model, the adventure builder enterprise
must transform its internal data representations which have their own data
model devised by its various EISs to this same canonical model.
The data translation between the internal and external representations can be
done before the data goes from the EIS into the application server that is, the
application server internally uses the canonical data model, which is generally
recommended. Or, the data translation can take place just prior to sending the data
out to the external world that is, the application server uses the various EISs'
native data representations. Sometimes the business logic necessitates this latter
approach because the logic needs to know the precise native format. The transla
tion is accomplished in one of two ways:
1. Use XSL style sheets to transform these alternate data representations, either
when data comes in or when data goes out. XSL style sheets work for XML
based interfaces. In this approach, the application server internally uses the EIS
<
New Page 1
Clan Web Hosting