Hello,
I have been working on a DAO design focusing primarily in maximizing the quality of the client code (maintainability, portability, etc) and trying to overcome many of the design issues (from the Software Engineering prospective) I found in many other attempts e.g.
- Possibility to have a pure JPA DAO base implementation that can be extended to provide non-JPA features e.g. extended by an specialized Hibernate that offers extra Criteria API support. The main issues here were the mismatching abstractions between pure JPA and native implementations.
- There are several ways to obtain and manage Sessions and Transactions, the aim of this design is to stay away from approaches that use Utility classes.
- Portability across different JPA implementations e.g. switching the DAO from a TopLink implementation to a Hibernate implementation should take only to use a different concrete initial Abstract Factory.
There are several examples that can be browsed online e.g. DAO pure JPA in EJB, Hibernate on JSE, Spring on JSE.
The UML design, downloads and links to xref sources can be found here:
http://perfectjpattern.sourceforge.net/ ... icdao.html
I will appreciate any feedback.
Best regards,
Giovanni