sockeqwe/sqlbrite-dao

Use Dao interface instead of concrete classes

Closed this issue · 1 comments

Please code to contracts for DaoManager. I may have be using an interface to refer to my Dao and I have to pass the concrete classes if Dao base class is needed as a param. Use an interface Dao if possible.

 public DaoManager(Context c, String databaseName, int version, Dao... daos)

Initially I provided a Dao interface and a default implementation AbsDao implements Dao as base class to extend from. But, all the SQL Query helpers like SELECT or CREATE_TABLE and so on are part of AbsDao (not static imports). Also in some other (private) DAO project I provided a Dao interface, but over 5 years I never implemented another implementation, I always used the default AbsDao implementation. So does it really make sense to have a Dao interface?