This J2EE utility can be used to seperate the DAO layer from the Buisness layer. This pattern
Factory Method
is a common pattern. Documentation about this pattern can be found at
J2EE Core Pattern.
My implementation uses the
Factory Method, but does not use the
Abstract Factory Method.
Instead of having a new implementation of the Factory for each data-source, there is a xml config file for each data-source.
The source can be view here:
com.mlw.util.dao.DAOFactory
(download)
.
Below is a sample of how the
Factory Method pattern is supported by the DAOFactory.