Chapter 6
275
When you use the EJB container managed persistence technology, you also can
rely on the EJB container's security features to control access to the data. You also
leverage the performance benefits of the EJB container managed persistence
engine, which uses data caching to improve performance. Finally, by using these
technologies, you can take advantage of the mapping tools that come with them.
The other option for representing relational data is to create a generic layer to
hold the data. For this approach, you use JDBC APIs to handle data from rela
tional data sources. The JDBC
RowSet
technology, in particular, makes it easy to
access relational data in an efficient manner. (Keep in mind, however, that JDBC
RowSet
technology is not yet standard in the J2EE platform.) The
RowSet
technol
ogy, through the
WebRowSet
feature, gives you an XML view of the data source. Its
CachedRowSet
capabilities lets you access data in a disconnected fashion, while
the
FilteredRowSet
functions give you the ability to manage data in a discon
nected manner, without requiring heavyweight DBMS support. By using a generic
layer to hold data, you have a simpler design, since there is no real layering, and
you avoid the conceptual weight of a formal data model. This approach may have
better performance, particularly when access is tabular in nature (such as when
selecting several attributes from all rows that match a particular condition).
E
To access data stored in non relational data sources, it is best to use connectors.
Connectors let you plug in non relational data sources to the J2EE environ
ment. For non relational systems that do not have ready made connectors avail
able, such as home grown systems, you need to write your own connector. See
Integrating Custom Legacy Systems on page 283.
6.4.2 Data Transformation
Data transformation the ability to convert data to an acceptable application
format is a common requirement for newer applications that need to access legacy
data. Such transformation functionality is necessary because most legacy systems
were not designed to handle the requirements of these subsequent applications.
To illustrate, a legacy system may store dates using an eight digit integer
format; for example, storing the date September 23, 2003 as
20030923
. Another
application that accesses this legacy system needs the same date formatted as
either
MM/DD/YYYY
or
09/23/2003
. The application needs to access the eight digit
date from the legacy system and transform it to a usable format.
<
New Page 1
Clan Web Hosting