When dealing with database(s) is it common to have a repository for each DAO or would one implement a repo that handles all DAOs?
All examples on the entire internet is dealing with 1 DAO….
:stackoverflow: 10
a
arekolek
04/24/2018, 7:45 AM
I think it makes sense that one DAO could use many tables, and that one repository could use many DAOs. But having one repository for all DAOs is going too far IMO
s
smedegaard
04/24/2018, 7:46 AM
Thanks @arekolek. That makes sense. It would grow pretty big in the life time of the app, I guess
w
withoutclass
04/24/2018, 2:19 PM
I've always thought of repos as a way to group DAO's, so your DAO should basically work on a single table, and then you can use a Repo to logically group DAO's together for queries that may require more than 1
So my repo's are usually
abstract class
, for doing specific multi query/transaction type stuff, and DAO's are usually