1) My question is should I have 1 interface each per DAO and the service layer should interact only with the interface. I am not using Spring for dependency injection. Nor do we have plans to change the implementation from Hibernate to some other OR mapping framework.
What are the benefits for this design? What are the disadvantages? If you have 20 DOA classes, will you then have 20 interface classes as well? Do you think the API of the DAO classes will change often?
2) Should i create a DAOFactory where in I statically pre-initialize all the DAO's in the environment and in the service layer fetch the DAO's from this factory rather than creating DAO instances on the fly.
I suggest having a factory class that creates the DAO objects for client objects. I would not attempt to "statically pre-initialize all the DAO's."
Client business objects should fetch the DAO's from this factory on the fly.
3) Should the methods inside the DAO (create/update/delete/find) be static methods.
Definitely not.
[ November 18, 2008: Message edited by: James Clark ]