sockeqwe / sqlbrite-dao

DAO for SQLBrite
http://hannesdorfmann.com/android/sqlbrite-dao
Apache License 2.0
182 stars 22 forks source link

Use Dao interface instead of concrete classes #15

Closed harinair closed 8 years ago

harinair commented 8 years ago

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)
sockeqwe commented 8 years ago

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?