Chapter 4. Evaluating Your Options

Now that you have a solid understanding of the central role that persistence plays in enterprise architecture and a history of how Java persistence mechanisms and related frameworks have evolved, your next step is to decide which one to use. For purposes of this book, the options you have to consider include Java Database Connectivity (JDBC), iBATIS, Hibernate, Open Java Persistence API (JPA), and pureQuery (a Language Integrated Query for Java). Chapter 1, “A Brief History of Object-Relational Mapping” provides the background on why these five options were chosen. In a nutshell, they represent a good baseline and cross section of the approaches to ORM used by the persistence mechanisms in common use when this book went to press.

This chapter will take you through some best practices for conducting an evaluation based on an objective questionnaire that we will use as a method and template for comparison in the following chapters.

Comparing Apples to Apples

Many people might take the adage about always comparing apples to apples literally, and simply start evaluating each of these five persistence mechanisms against each other to determine which one is best. This “exhaustive” approach to comparison is shown graphically in Figure 4.1.

An exhaustive apples-to-apples comparison among persistence frameworks.

Figure 4.1. An exhaustive apples-to-apples comparison among persistence frameworks.

An exhaustive apples-to-apples comparison among persistence frameworks.

A.4.1

One problem with an exhaustive comparison is that it is relatively expensive. You would have to make 10 separate comparisons to rank the 5 mechanisms with respect to one another. If you decide to consider another persistence framework, such as SQL for Java (also called SQLJ), which has many excellent articles on how to use it [A.4.1], you would have to evaluate 5 more mechanisms for a total of 15. Consider another on top of that, such as TopLink JPA (see its website for details [Toplink]), and you have to compare 6 more for a total of 21. The relative effort of the evaluation increases according to the general formula: n(n -1) / 2, where “n” is the number of mechanisms being evaluated. This formula pegs an exhaustive evaluation as an O(n2) solution—an approach to be avoided if there is any way around it.

For those not familiar with the “O” notation, it is a formal way to describe the “order” of computational complexity, and is useful for comparing solutions (as we are doing now with respect to evaluation approaches).

Putting Good, Better, and Best into Context

But this analysis of complexity is somewhat putting the cart before the horse. Labels like “better” and “best” have meaning only within a specific context of measurement and interpretation of the resulting values. This context determines the specifics of how to compare two or more frameworks against each other.

For example, you could simply compare the number of Java methods associated with each API that you can glean from documentation on the assumption that the one with more functions is better.

We do not recommend this approach because it leaves you at the mercy of misleading marketing materials or incomplete documentation. Also, it is not clear that more methods make a framework better. However much people may disagree about the value of a given measurement or its interpretation, within that context there is no argument about which framework is better or best—and therein lies the value of objectivity.

Establish an Independent Standard

The pentagon formed in the center of Figure 4.1 hints at much better context for comparison—if you consider it to represent the union of the features supported by the five options. You can think of each feature in the union as implying a “yes/no” question in a checklist, such as this:

  • Does the framework support <feature X>?

A union of features is better because you are measuring against a relatively independent standard. An independent standard enables us to establish what an ideal framework should support, and compare what each mechanism actually supports against that ideal.

A helpful side effect is that an evaluation against a standard like a union of features is actually simpler than an exhaustive one—because you do not compare the features of every framework with every other. Instead, you merely compare the features of each mechanism to the checklist (making this an O(n) solution). And the comparison is still among “apples” if you consider the superset of features in the union as the “best” possible example of a persistence mechanism (sometimes called an archetype), as shown in Figure 4.2.

Using a union of features as an independent standard for comparison.

Figure 4.2. Using a union of features as an independent standard for comparison.

Developing a union of features is pretty straightforward. First pick an arbitrary framework and use its features as the starting point for the union. Then examine each other mechanism in turn, enumerating its features and adding any not already found in the current set.

For example, here are some introductory paragraphs about JDBC we found by browsing Wikipedia:

JDBC is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases.

The Java Platform, Standard Edition, includes the JDBC API together with an ODBC implementation of the API enabling connections to any relational database that supports ODBC. This driver is native code and not Java, and is closed source.

This cursory description leads to some good questions to ask about every framework that you might not have thought to consider, such as these:

  • Is the framework part of Java Platform Standard Edition (JSE)?

  • Is there an open-source implementation?

Deeper digging into the materials shows that JDBC supports invoking arbitrary SQL statements and batching multiple statements into one request—providing full functionality and efficiency. Therefore, you should consider asking the following questions as well:

  • Does the framework support invoking arbitrary SQL statements?

  • Does the framework support batching multiple statements?

Turning next to iBATIS, its Wikipedia article begins with the following:

iBATIS is a persistence framework which enables mapping SQL queries to POJOs (Plain Old Java Objects). The SQL queries are decoupled from an application by putting the queries in XML files. Mapping of the retrieved objects is automatic or semi-automatic.

These features are important for ease of use and maintainability, and lead to even more questions to think about:

  • Does the framework support automatic mapping of query data to Java objects?

  • Does the framework support modifying queries independent of the Java code?

Hibernate, pureQuery, and JPA each add their own features to the union as well; but as you examine each framework in turn, you add fewer and fewer (because most of the features have already been encountered).

Make a List and Check It Twice

After you complete the union from the initial scan of each framework, the next step is to examine each again and determine whether it supports each of the features in the checklist. This second scan is important because it may be that a given mechanism supports a feature but never explicitly documented that fact. The total number of features supported usually increases. At the same time, you find out how many features a framework does not support.

It is possible to compare as you go while developing the union as long as you recheck each previously evaluated mechanism whenever a new feature is added. However, this approach is functionally equivalent to a second scan.

To illustrate, Table 4.1 summarizes the evaluation against the checklist questions we discussed so far.

Table 4.1. Results of the Evaluation Against the Checklist of Features Derived from the Union

 

JDBC

iBATIS

Hibernate Core

OpenJPA

pureQuery

Part of Java SE or EE Standard

Y

  

Y

 

Open Source

 

Y

Y

Y

 

Arbitrary SQL

Y

Y

Y

Y

Y

Batching

Y

Y

Y

Y

Y

ORM

 

Y

Y

Y

Y

External Queries

 

Y

Y

Y

Y

      

Total supported

3

5

5

6

4

Not supported

3

1

1

0

2

Percent

50

83

83

100

66

It is reasonable to consider the framework with the most features supported, or the fewest not supported, or the largest percentage as “the best” within this context. Any of these three measurements used to summarize the table would serve as a more meaningful context for comparison than a simple count of advertised features.

Keep It Real

Comparing to a union of features is not likely to be a satisfactory basis for your choice of mechanism because you are still at the mercy of what the framework documentation has to say about which features are important. Even though you have a collective group of opinions to consider, the basis for comparison is not truly independent.

An even more meaningful context for comparison is to create a list of your project’s requirements with respect to persistence features and then evaluate each framework against that checklist. This focus on your project requirements also ensures that the label “best” has a practical meaning—it is applied to the mechanism that does the best job of meeting your needs.

One benefit is that even less effort is required than that to compare against a union of features. You do not need to exhaustively research all the frameworks first to develop the union; you simply determine whether a given framework has the required features—which are likely to be a much smaller subset than the complete union, but still another form of “apple,” as Figure 4.3 shows.

Using your project requirements as a more practical standard for comparison.

Figure 4.3. Using your project requirements as a more practical standard for comparison.

Focusing on your immediate needs can further simplify an evaluation because you can stop considering an option that fails to meet a “must have” requirement. For example, project “A” may require a robust ORM that allows you to reject JDBC as the mechanism early in the evaluation process.

A more complete approach would be to weight each requirement based on its importance to your project, and then choose the framework with the highest score.

However, this continual comparison to project requirements, even though they are a smaller list than the union, is reminiscent of an exhaustive comparison (Figure 4.4 illustrates the similarity to Figure 4.1). In fact, the long-term costs are likely to be more than for an exhaustive comparison.

Long-term cost of using individual project requirements as a context for comparison.

Figure 4.4. Long-term cost of using individual project requirements as a context for comparison.

But there are other issues with this “every man for himself (or herself)” approach to evaluation. One is that you are spending time evaluating frameworks when you should be implementing applications. Another is that an inexperienced team may not know the right questions to ask. And still another is that you may end up with inconsistent implementations across the enterprise even when the projects are similar.

Persistence in Your Enterprise

The word “enterprise” suggests a solution. Just as it is better to develop an independent standard from a union of advertised features and compare against that, it is better to develop a comprehensive checklist of enterprise requirements from a union of those features needed in previous (or proposed) projects.

Given our previous examples, project “A” would contribute ORM support as an enterprise requirement, project “B” would add the need for dynamic SQL, and project “C” would need both.

Ultimately, your enterprise requirements go far beyond just the technical features usually described in the framework documentation, and include aspects such as business drivers and functional and nonfunctional requirements that we discussed in previous chapters. These aspects lead to additional questions that you should consider in your enterprise wide checklist, such as the following:

  • Are there referenceable projects that have successfully used this framework?

  • Is there a large pool of practitioners skilled in using this framework?

Another benefit of this broader focus is that only one evaluation of the frameworks against the enterprise requirements is needed to support making your choices later. Your checklist of enterprise requirements becomes the ideal superset of features to compare the frameworks against—still keeping it “apples to apples,” as shown in Figure 4.5.

Using your enterprise requirements as a standard to drive a single evaluation.

Figure 4.5. Using your enterprise requirements as a standard to drive a single evaluation.

One Size Does Not Fit All

However, you should consider the possibility that you need to choose two or even more frameworks for use within the enterprise—not because they end up with the same objective score in an evaluation, but because there are important underlying differences in the requirements of different types of projects.

So when you develop your checklist of enterprise requirements, create a weighted subset for each kind of project that you are likely to encounter, and optimize the choice of framework for each type.

For example, it is likely that highly tuned custom applications such as the order entry system for project “A” (we might call these “compiled” applications) would benefit from an object style programming model provided by Hibernate, or OpenJPA. But it may be that highly dynamic “metadata”-driven applications like the marketing analysis system developed by project “B” would require iBATIS or pureQuery (we might call these “interpreted” applications). Figure 4.6 graphically shows the relationship between these two project types and individual project requirements within the enterprise.

Relationship of project types to the enterprise and project requirements.

Figure 4.6. Relationship of project types to the enterprise and project requirements.

The possibility of choosing multiple frameworks implies that you should ensure that they can work together—adding the ability to integrate with other frameworks, such as JDBC, to your checklist of enterprise requirements to consider. Some requirements, like this one about integration, may be important for a number of project types—implying that a hierarchy of project types would be useful to minimize redundancy.

Ask Not If, but What and Why

But the problem with checklists of features phrased as “yes/no” questions is that for most interesting aspects of persistence (and life in general), the answers are not really black and white. Most of the time there are shades of gray.

For example, consider the question about whether a framework is available under open source. The description about Hibernate found in Wikipedia provides an answer:

Hibernate is an object-relational mapping (ORM) solution for the Java language. It is free, open source software that is distributed under the GNU Lesser General Public License. It provides an easy to use framework for mapping an object-oriented domain model to a traditional relational database.

The answer was much more specific than just yes, and indicated that it was available under LGPL. We explore LGPL and other license agreements like GPL and Apache with respect to their impact on your ability to sell your applications in Chapter 2 “High-Level Requirements and Persistence.” In short, there are usually trade-offs to consider for each one, and most frameworks would answer yes to only one in the set. So rather than asking a number of related “yes/no” questions, like

  • Is the framework distributed under GPL?

  • Is the framework distributed under LGPL?

  • Is the framework distributed under a license from Apache?

it would be better to ask a single, more open-ended “what” question, such as the following:

  • Under what open-source licenses is the framework distributed?

This single “what” question not only minimizes the number of questions you have to ask, but also makes it clear that you are evaluating an important aspect of your enterprise requirements.

The Devil Is in the Details

This transformation of many related questions into one that is somewhat open-ended also illustrates that most often, it is not a question of “if” a given framework supports a requirement, but one of “how.” In other words, the devil is in the details.

The underlying question we are after concerning the type of license agreements is this:

  • How is the framework distributed?

A “how” question like this is usually too open-ended for an apples-to-apples comparison—leading us to substitute one or more “what” questions like that given previously. For another example, consider the third sentence from the Hibernate description again (bold italics ours):

...it provides an easy to use framework for mapping an object-oriented domain model to a traditional relational database.

Certainly every framework would like to claim that it is easy to use, so asking a “yes/no” question is rather useless; a completely open-ended “how” question is nearly so:

  • How is the framework easy to use?

One reason is that the notion of whether a framework is easy to use is a subjective evaluation that applies to the framework as a whole. A better “how” question is specific and objective:

  • How many steps does it take to achieve a given task?

Within this context, the framework with the fewest steps across all the tasks evaluated would be considered the “best” with respect to ease of use. The questionnaire to drive the data gathering might start with a “what” question around a specific feature, coupled with a very specific question about how that particular feature is used for that task. For example, support for isolation levels could be objectively evaluated with the following two questions:

  • What isolation levels are supported?

  • How are they specified?

The details provided by the “how” questions make it easy to objectively compare the complexity of the solution with that of others—as long as the same example is used for each framework to minimize the open-endedness.

An evaluation based on this amount of detail allows you to apply Occam’s Razor and choose according to its age-old best practice: “All things being equal, the simplest solution tends to be the best one.”

An Evaluation Template You Can Use

Now that you know how to conduct an objective evaluation and what general kinds of questions to ask, you have all the tools you need to create your own questionnaire and conduct your own evaluation. But because the devil is in the details, we go a step further and extract a questionnaire from enterprise requirements discussed in the previous chapters that you can use as a starting point for your own evaluations.

Our questionnaire is very comprehensive, with the following sections:

  • Background

  • Architectural Overview

  • Programming Model

  • ORM Features Supported

  • Tuning Options

  • Development Process for the Common Example

Each section begins with the major questions that the section is intended to answer, followed by specific subsections with more detailed questions.

Background

This section is most closely related to Chapter 1, “A Brief History of Object-Relational Mapping,” where we discuss the various frameworks that you might want to consider in your evaluation. Specifically, you want to be able to answer the following general questions:

  • Why is the framework is popular enough that you chose it to evaluate?

Type of Framework

  • What approach to persistence does this mechanism support?

History

  • How did this framework evolve?

Architectural Overview

This section is derived from the discussion about business drivers in Chapter 2 and is intended to capture some of the more intangible “costs” of moving to that particular mechanism. A reviewer should be able to answer the following questions:

  • What are the basic components of the framework and how they interact?

  • Show a high-level diagram that includes development tools and runtime servers.

Standards Adherence

  • What standards does this mechanism support?

Platforms Required

  • What software and hardware platforms does this technology require for the runtime?

Other Dependencies

  • What other Java technologies are needed in order to use this one?

Vendors and Licenses

  • What vendors or open-source communities currently offer this framework?

  • For each one listed, what kind of license is available?

  • For each listed, how can you obtain a trial and/or production download?

Available Literature

  • What kinds of educational material and reference guides are available? (Provide a link to various sources where available.) Consider using the following table format for clarity:

    Title

    Source

    Description

       
       

Programming Model

The purpose of this section is to drill down to see how the framework can be used to support the basic usage patterns found in Java applications needing persistence discussed in Chapter 2.

  • What is the programming model like in terms of components you have to develop and the language you use for each?

  • What is the “lifecycle” of a persistent object with respect to framework and application components?

Initialization

  • What kind of initialization is required to access the framework API within your service implementation?

  • Show the code required to initialize the framework before a query of Customer with id = 100.

  • Show how to set up the framework with the Derby JDBC driver and also how to use an application DataSource with JNDI name jdbc/Derby/DataSource.

Connections

  • What kind of connection model is supported?

  • Show an example of explicitly creating a connection with the same query used in the initialization section (if supported and not already shown in the initialization section).

  • Show how to set the database connection pool size to 20.

Transactions

  • What kinds of transactional control are supported by the framework?

  • Show an example of grouping two update statements into a single user-defined transaction. If possible, use the following updates:

    1. Update a business customer with id = 100 such that businessPartner = false.

    2. Update that customer’s openOrder such that status = ‘SUBMITTED’

  • Show an example of configuring the framework to use global transactions with an application server (such as with JTA).

  • What isolation levels are supported?

  • For each that is supported, show the code required.

Create

  • Describe the general approach to creating objects within the framework.

  • Show the code required to create a new ResidentialCustomer.

  • Show the code required to create a new Order owned by the Customer.

Retrieve

  • Describe the general approach to queries and object retrieval within the framework.

  • Specifically, are dynamic queries supported?

  • Show the code required to retrieve a single Customer that matches a given primary key.

  • Show the code required to retrieve all Customers that are “active” (specifically, all CUSTOMERS that have an OPEN_ORDER).

Update

  • Describe the general approach to updating objects within the framework.

  • Show the code required to change the quantity of a LineItem. Specifically, update a LineItem with a given customerId (assume it’s already defined) to a quantity of 100.

  • Show the code required to change the OpenOrder attribute to Null.

Delete

  • Describe the general approach to deleting objects within the framework.

  • Specifically, is cascaded delete supported?

  • Show the code required to delete a LineItem.

  • Show the code required to delete an Order and all associated LineItems (through a cascaded delete, if supported).

Stored Procedures

  • Describe the general approach to invoking stored procedures within the framework.

  • Show the code required to call the following “swap order” Java stored procedure:

    <LINELENGTH>90</LINELENGTH>
    SwapPojo orderIds = new SwapPojo();
    orderIds.setFirst(orderId1);
    orderIds.setSecond(orderId2);
    dm.update("swap.order",orderIds);

Batch Operations

  • Describe the general approach to supporting batch operations within the framework.

  • What kinds of update operations are supported in batch mode?

  • For each operation supported, show an example.

Extending the Framework

  • Describe any possible extension or plug-in points with brief examples of interfaces/APIs.

  • If the framework supports plugging into a distributed caching framework, you may want to defer this example to the distributed caching section.

Error Handling

  • Describe the general approach to handling exceptions in the framework. If possible, consider including a class diagram showing the hierarchy in UML or your favorite notation.

ORM Features Supported

The questions in this section are derived from Chapter 3, “Designing Persistent Object Services,” first focusing on the static definitional elements of the ORM problem. Specifically:

  • How does the framework alleviate the object-relational impedance mismatch problem and make the life of the developer easier?

  • Are there any ORM features that are unique to this framework for common problems like object identity (such as key generation) or the load-time paradox (navigating large collection relationships)?

Objects

  • Describe the general approach to mapping objects within the framework.

  • Show how you would define an Order object.

Inheritance

  • What types of inheritance does the framework support?

  • For each type of inheritance supported, show how the framework is used to specify that a ResidentialCustomer inherits from an AbstractCustomer.

Keys

  • What types of key attributes are supported?

  • Show how you would define that an Order has an auto-generated key.

  • Show how you would define that an Order has a simple integer key (if not already covered in the programming model section).

  • Show how you would define that a LineItem has a compound key consisting of an Order key and a Product key.

  • What key generation options are available? Specifically, does the framework offer key generation independently of the underlying database (for example, generating a UUID)?

  • What database-specific methods are supported?

  • Show how you would define that an Order has an auto-generated key.

Attributes

  • What types of attributes are supported?

  • How are they mapped to the underlying database?

  • Show how you would define that a LineItem has a BigDecimal quantity attribute and how it can be mapped to the Derby type of BIGINT

  • Show how the Order.Status enumeration can be mapped to VARCHAR(9) of OPEN, SUBMITTED, and CLOSED.

Contained Objects

  • What kinds of contained objects are supported?

  • Show how you would define that a Customer contains an Address object.

Relationships

  • What “directionality” of relationships does the framework support?

  • What cardinality does the framework support?

  • Show how to use the framework to specify that an Order is related to a Customer.

  • Show how to use the framework to specify that a Customer is related to many Orders.

  • Show how to use the framework to specify that a Customer can reference at most one OpenOrder.

Constraints

  • What types of constraints on attribute values does the framework support?

  • Can the framework leverage underlying database constraints?

  • Show how the framework is used to specify that a Product referred to by a LineItem must be in the Cataloged state. For this example, add a new field to Product called cataloged that is a Boolean.

Derived Attributes

  • What types of computations are supported for “derived” attributes?

  • Show how you would define that a LineItem amount attribute is computed by multiplying the price by the quantity.

  • Does the framework support derived attributes that operate on properties from more than one (related) object?

  • If so, show how you would define that a LineItem amount attribute is computed by multiplying the Product price by the LineItem quantity.

  • Does the framework support derived attributes that represent operations across the elements of a collection?

  • If so, show how you would define that an Order total amount attribute is computed by summing the associated LineItem amounts.

Tuning Options

This section is derived from questions in Chapter 2 concerning quality of service IT requirements. You should be able to answer questions like the following:

  • How does the framework make tuning at runtime easier without requiring code changes?

  • Are there any tuning features unique to this framework?

Query Optimizations

  • What approaches to optimizing queries are supported that do not require changing the Java code?

  • For example, is it possible to change the number of rows returned by a query?

Caching

  • What kind of caching strategies are enabled by the framework?

  • For example, does the framework have its own “single JVM” cache that can be configured?

  • If so, show how you would cache Products (because they change relatively infrequently).

  • How do you handle cache invalidation?

  • Does the framework support integration with a “third-party” distributed cache?

  • If so, show how that would be done within the framework.

Loading Related Objects

  • What support does the framework provide for “hydrating” objects related to the target?

  • Does the framework support “lazy loading” such that specific related objects can be declared to be loaded only when explicitly referenced in the application code?

  • If so, show how you would configure the framework to indicate that the LineItems are lazy-loaded.

  • Does the framework support “preloading” such that specific related objects can be declared to be loaded at the same time that the referencing object is loaded (which usually results in a join operation on the database)?

  • If so, show how you would configure the framework to indicate that the Product related to a LineItem is preloaded whenever the LineItem is loaded.

Locking

  • Describe the general approach to configuring locks on objects independently of the Java code.

  • What kinds of configurable locking strategies are supported?

  • Show how each would be enabled within the framework configuration options.

  • Does the framework support ordering of operations outside of the code to minimize deadlock conditions?

  • If so, show how this is done through configuration options.

Development Process for the Common Example

The purpose of this section is to show the end-to-end steps required to develop the services shown in the common example outlined in Chapter 3. The overarching questions include the following:

  • Are there any development steps that are simplified by or unique to this framework?

Defining the Objects

  • Describe any steps needed to map the Java objects to the underlying relational stores.

  • Specifically, are there any specific tools that need to be run?

  • If so, show when and how they get invoked.

Implementing the Services

  • Describe any special considerations for implementing services that are unique to this framework that may limit their portability.

Packaging the Components

  • Describe any special considerations for packaging the code components and the configuration components.

  • Are there any specific naming or project/directory structure conventions that need to be followed?

  • Are there any special tools that need to be run to compile or bind components?

  • If so, show when and how they get invoked.

Unit Testing

  • Describe any approaches unique to this framework for handling unit testing.

Deploying to Production

  • Describe any approaches unique to this framework for deploying the applications to production.

  • Specifically, are there features that make it easy to move from a system test to production environment with little or no configuration changes?

  • Are there any special tools that need to be run?

  • If so, show when and how they get invoked.

Making the Most out of Your Experience

Of course you will want to follow our earlier advice to keep it real and customize this questionnaire to the needs of your enterprise, taking into account your unique culture and requirements. For example, you may want to consider adding scenarios that are meaningful to your own enterprise as sections because they will give the best impression of the complexity of a given framework with respect to the functionality it delivers.

Use the Questionnaire Early and Often

To help offset the cost of customizing the questionnaire, we recommend that you reuse it as a starting point for your project requirements. This approach will ensure that your more inexperienced project teams do not overlook a crucial requirement.

Also, constant use of the questionnaire on actual projects gives you lots of opportunity to validate them and keep them current. If a new project represents a new type or comes up with some new requirements, you should first add them to your enterprise questionnaire. Then consider whether to evaluate each project in progress with respect to the new requirements.

Depending on the situation, you may need to revisit your choice of persistence frameworks being used in your production applications—especially if you found a problem during development and testing that led to the new requirements to consider in the future.

We have seen a questionnaire like this one used in other ways, too. In one project, we used it to review the project team’s choice of persistence mechanism. This questionnaire helped us to ask the right questions in a systematic fashion and get to the heart of the reasons for their choice.

Record Your History So You Don’t Repeat It

Whether you use this questionnaire in practice to conduct your own formal evaluations or review the work of others, make sure to record your answers and choices so that you don’t forget them later and have to revisit.

A soft-copy version of the questionnaire in Microsoft Word is available on the download site, ibmpressbooks.com/title/9780131587564. You are welcome to use this template as-is or as a starting point for your own evaluation and review questionnaire.

We use this same template as a starting point for the next five chapters, which evaluate JDBC, iBATIS, Hibernate, OpenJPA, and pureQuery. Feel free to contact any of the authors if you would like to share new questions or reviews of other persistence mechanisms—whether exciting new ones or exciting ones still in common use. In this manner we can all learn from each other and avoid repeating ourselves.

Summary

That said, sometimes it is good to repeat yourself—especially in a summary. This chapter covered a number of best practices to follow when evaluating persistence frameworks for use in your projects. And if you can only remember “top ten lists” (with apologies to David Letterman), here are 10 key points to keep in mind:

  1. Be objective. Labels like “better” or “best” have meaning only within a specific context of measurement and interpretation of the results.

  2. Be unbiased. Measure against an independent standard rather than what a given framework chooses to advertise.

  3. Be practical. With respect to providing an independent standard for evaluation, a union is good but your project requirements are better.

  4. Be comprehensive. Develop a complete checklist of enterprise requirements as a union of those from previous projects.

  5. Be flexible. Different project types have different enterprise requirements, so factor a separate checklist to choose the best framework for each project type.

  6. Be open-ended. It is better to ask a single “what” question about an aspect of the requirements than many related “if” questions.

  7. Be specific. Follow your “what” questions with a “how” question that clearly defines a scenario so that the details can be compared as well.

  8. Minimize redundancy. Consider building a hierarchy of project types with common enterprise requirements checklists in the more “abstract” types.

  9. Maximize reuse. Use your requirements checklists as a starting point for your new projects to minimize your analysis and design costs.

  10. Remain relevant. Adjust the questions and reevaluate your choices based on actual project experiences.

This chapter also provided a detailed questionnaire that you can use as a starting point for driving and documenting your own formal evaluations and reviews. We use this questionnaire in the remaining chapters of this book.

Links to developerWorks

Links to developerWorks

A.4.1

Developing Your Applications using SQLJ

 

An article by another ISSW consultant, Owen Cline, which describes practical uses of SQLJ in Java applications, including ones that use EJB components.

 

www.ibm.com/developerworks/db2/library/techarticle/dm-0412cline/

References

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset