JDBCPersistence & Object Relational Mapping (ORM)
JDBCPersistence is an Object Relational Mapping Framework. Designed for use in high volume online banking application the package delivers performance matching of that exhibited by hand written JDBC code.
The differentiating features of JDBCPersistence are a result of the focus placed first and foremost on performance followed by making programmer most effective by building on existing knowledge of SQL, JDBC APIs, IDEs and, at the same time, avoiding creation of dependencies on specific libraries, tools, IDEs.
The framework strikes a good balance in what it provides verses what it requires a programmer to do in order to use it, e.g. a programmer could quickly prototype value objects by specifying them as Java interfaces and asking the framework to provide implementation for these interfaces at runtime, thus allowing to go from specifying an interface to using it in no time.
On the other hand, recognizing that data relationships are governed by business rules much more complex than could be specified in a typical ORM configuration file, a programmer is required to maintain such relationships in code.
The focus of the framework is to provide ORM services while leaving other concerns, in particular, data caching, up to the developer to solve in the context of an application. Being aware that the caching requirements may be different in online vs. batch application, the framework does not prescribe a solution. Developer needs to decide on application specific caching policy and implement it in an architectural layer (DAO) designed to function in both contexts.
The framework does not add any behavior to the classes that comprise the application. Classes supplied by the developer are the classes that will be used by the application when it runs.
JDBCPersistence uses bytecode generation technique to create bytecode for classes that implement logic used for persisting the data. Such, for every, loosely speaking "Java Bean", that requires persistence, a persistor class that implements CRUD operations is created. As opposed to using reflection, the approach of generating bytecode is apt to further optimization by JVM.
JDBCPersistence takes bytecode generation a little further by providing a feature that allows generating complete implementation of a value object specified as an abstract class. Similar to generating full implementation for Java interface class that describes value object class, the framework can generate implementation for all abstract methods of an abstract class representing value object.
As all of the bytecode generation takes place at run time, there is no impact on development or build process. The approach of generating bytecode at runtime is also used by RMI implementation of the Java Platform starting with version 5.0.
The API of the framework builds on the existing JDBC APIs. JDBCPersistence's public API adds four classes and three interfaces. As the framework uses SQL for queering the data a curve associated with learning framework specific query language is avoided.
Keeping it simple, JDBCPersistence' only dependency is ASM, which is used for bytecode generation. The footprint of the package is under 200K.
I would like to collect some responses form the users of the framework on implementing JPA. If you have any thoughts on this matter please feel free to share them with me using Feedback link below.