Choose the Right Object Persistence
Making a choice among JDBC, CMP, and JDO can be critical in enterprise application design
By Dr. Wilson Cheng and Dr. Pinaki Poddar
Choosing the right object persistence technology for your enterprise application—how business domain objects are created, retrieved, updated, and deleted in a data store while preserving transaction integrity—is critical in Java application design. Here we'll give you guidelines and a method for choosing among three leading object persistence technologies: JDBC, CMP, and JDO. We present six dimensions that characterize object persistence issues for any enterprise application. We also provide generalizations about JDBC, CMP, and JDO to aid you in your decision-making (see the sidebar, "Object Persistence Technologies").
Because choosing the right object persistence technology is a multidimensional problem, you should select a technology for its overall suitability to the primary requirements of your enterprise application. All issues of object persistence can be grouped into six dimensions. These six dimensions or generic requirements are inherent in the design of any enterprise application regardless of its particular business domain:
- Transformation of domain object model to data store representation
- Query mechanism to retrieve objects from the data store
- Transaction state management
- Scalability and performance features, such as caching and fetch on demand
- Portability across changes in data store schema, data store technology, or vendor
- Mechanics such as ease of development, deployment configuration, and testing
First, we present a summary scoring of JDBC, CMP, and JDO object persistence service for each of these six dimensions and a visual representation of that scoring. Then we present the rationale for the summary scoring by addressing JDBC, CMP, and JDO point by point in light of the six dimensions. Table 1 summarizes the suitability of JDBC, CMP, and JDO support for enterprise application requirements by way of the six dimensions of object persistence. We use a three-point scale: good support is given a numeric score of 3; moderate support is given a numeric score of 2; and negative or no support is given a numeric score of 1.
The total scores of the three services are presented only as indicators to their overall efficacy. They should not be taken as the absolute criteria for judgment because of the multidimensional nature of these services. As we will see in a subsequent discussion, each technology has its strength in certain dimensions; for example, JDBC has the most powerful query expression despite having the lowest overall score (see Table 1). Perhaps a better way to see the multidimensionality of JDBC, CMP, and JDO support for the six dimensions of object persistence is shown in Figure 1. The adequacy of each technology is graphed on a hexagon where each vertex represents one of the dimensions. An ideal object persistence technology would cover the hexagon entirely.
The primary object persistence issue is the transformation or mapping between a domain object model and its data store representation. We are all familiar with the table-column representation of RDBMSs. However, OODBMS, file systems, and proprietary storage systems are also used in enterprise data management. With the notable exception of OODBMS, all storage mechanisms represent data differently than the object-oriented representation.
Back to top
|