DekGenius.com
[ Team LiB ] Previous Section Next Section

Chapter 8. Alternative Persistence Frameworks

Reason must in all its undertakings subject itself to criticism; should it limit freedom of criticism by any prohibitions, it must harm itself, drawing upon itself a damaging suspicion. Nothing is so important through its usefulness, nothing so sacred, that it may be exempted from this searching examination, which knows no respect for persons. Reason depends on this freedom for its very existence. For reason has no dictatorial authority, its verdict is always simply the agreement of free citizens, of whom each one must be permitted to express, without let or hindrance, his objection or even his veto.

—Immanuel Kant, The Critique of Pure Reason

As an enterprise application architect, you have more options than just choosing between a persistence model blessed by Sun and rolling your own model. In fact, alternative persistence models have been gaining in popularity recently for a variety of reasons:

  • EJBs are complex and heavy and they require an application server.

  • JDBC is time-consuming and requires a significant degree of database programming skill.

  • JDO is late on the scene and still lacking in implementations.

A quick search of the Internet will reveal a variety of alternative persistence systems. Two of the most popular are the Castor JDO (not an implementation of the Sun JDO specification) and Hibernate projects.[1] This chapter looks at Castor and Hibernate as alternative XML object-relational mapping tools.

[1] Both are open source projects available at SourceForge (http://www.sourceforge.net).

Software Requirements

Castor and Hibernate are not a standard part of any Java platform. You therefore need a host of tools to support these APIs. Each API has a different set of requirements, which you can find more about at their respective home pages:


Castor

http://castor.exolabs.org.


Hibernate

http://hibernate.sf.net.


    [ Team LiB ] Previous Section Next Section