I have a bunch of DAO classes that extend the class called BaseDAO, that has instance variables like ....
private Connection _conn = null;
private boolean b_connIsReference = false;
private PreparedStatement _pstmt = null;
private Statement _stmt = null;
private ResultSet _rs = null;
private OracleCachedRowSet _crs = null;
private OracleConnectionFactory _connfactory = null;
/** stored procedure use */
private CallableStatement _cs = null;
/** @associates
String */
private ArrayList a_columnNames = new ArrayList();
/** @associates String */
private ArrayList a_whereValues = new ArrayList();
Besides that the DAOs' that extend the BaseDAO. The corresponding DAOs also have the instance variables.
An instance of BaseDAO is created every time to get a copy of the instance variable.
An instance of corresponding DAO is also created whenver the DAO is has a request.
The apllication is working with out any issues.
Question...
Is it OK to have instance variables in DAOs?
Is my current design efficient?
Appreciate expert opinion and thanks in advance.
[ November 05, 2006: Message edited by: Bear Bibeault ]