Better ways to implement DAOs

From: tpcunha (tpcunha_at_gmail.com)
Date: 01/13/05


Date: 12 Jan 2005 17:36:51 -0800

Hi everybody,
Please, i'd like some tips for implementing a good-quality DAO.
For example, is this structure good?:

MyTableDAO [interface]
DBMyTableDAO [implementation]
MyTableDAOFactory [singleton]

All queries (insert, delete, update, select) are defined in
DBMyTableDAO. And the initialization of Collections of DTOs (for a
select that return a resultSet with more than one record) and single
DTOs (for searchs using the primary key, for example). This makes the
code quite confusing, also because of try-catch blocks.
Are there better ways to make DAOs?

Thanks.