npublic abstract class DAOFactory {
n // List of DAO
types supported by the factory
n
public static final int CLOUDSCAPE = 1;
n
public static final int ORACLE = 2;
n
public static final int SYBASE = 3; ...
n /* There will
be a method for each DAO that can be created. The concrete factories will
have to implement these methods. */
n public abstract CustomerDAO
getCustomerDAO();
n public abstract AccountDAO
getAccountDAO();
n public abstract OrderDAO getOrderDAO();
...
n public static DAOFactory getDAOFactory(
int whichFactory) {
n switch (whichFactory) {
n case CLOUDSCAPE: return new
CloudscapeDAOFactory();
n case ORACLE : return new
OracleDAOFactory();
n case SYBASE : return new
SybaseDAOFactory(); ...
n default : return null;
n }
n }
n }