I understanding I'm bind my DAOs to a particular sqlmap config being loaded, but other than some 'purist' unit testing issues, what's wrong with this simple approach (I'll have a couple different base DAOs that will load a different config file because going against a different DB.)
public abstract class GuiDAO { public static final SqlMapClient sqlMap = DaoUtil.loadSqlMapClient("sqlMapConfig-gui.xml"); } public class UserDAO extends GuiDAO { private static UserDAO instance = new UserDAO(); private UserDAO(){} public static UserDAO getInstance() { return instance; } public User getUserByDmzID(String dmzID) throws SQLException { return (User)sqlMap.queryForObject("User.getUserByDmzID", dmzID ); } //... } Other daos that need a different db will extend a different parent DAO. What are the big drawback to this?