The Dasein Persistence Library is a suite of Java classes that enable you to create EJB-like components without the complexity of EJBs and without the inflexibility and performance issues of other automated persistence systems.
The core piece of the DPL is a system for managing transactions in a J2EE container and isolating database access in easy-to-manage classes. In most cases, these easy-to-manage classes are automatically generated for you so that you never even know they exist. If you need greater flexibility, however, you can write your own and still leverage the ability to adapt to changes in the object model and participate in Dasein transactions.
It is, of course, the trendy belief to think that you should never write JDBC code and that all database access should be automated via API's like JDO or container managed persistence in EJB's. With this belief so prevalent, is it any wonder database applications perform so poorly?
For a quick overview of programming with Dasein, take a look at our Programming with Dasein presentation.
The Structure of DPL
This library is designed to leverage the caching features of The Dasein Utility Library to create a shared-object infrastructure much like Enterprise JavaBeans—without the complexity.
Every entity has a class representing that entity and a factory that manages its cache. For example, if you are modeling "employees", then you will create an Employee class and an EmployeeFactory. The Employee class will have only "getter" methods—no "setters". These getters provide access to all of the data associated with an employee.
The Employee will also have a standard, empty constructor. It does not have to extend or implement anything else.
Similarly, the EmployeeFactory has no base class or interface that it must extend. It will use the PersistentFactory class to manage a memory cache of Employee instances.
That's all there is to it. The DPL manages all of the hard stuff like:
- supporting the inserts, updates, deletes, and common selects behind the business object
- caching stuff in memory to minimize database access
- setting object attributes from values retrieved from the database
- combing statements into a single transaction
Requirements
The Dasein Persistence Library requires a Java 5 JVM and the following two JARs:


