reset password
Author Message
Sridhar16
Posts: 10
Posted 00:23 Jul 16, 2015 |

Hello Dr Sun,

Should I create separate DAO classes and interface for all the methods or can we write the methods in UserDao itself ?

cysun
Posts: 2935
Posted 08:39 Jul 16, 2015 |

I think there's no strict requirement, but the general practice is to separate DAO methods into DAOs based on the type of objects that they deal with. For example, getUser() and getUsers() return User objects so they should be in UserDao; getJob() and getJobs() return Job objects so they should be in JobDao.