timmy00274672 / AndroidPractice

Example of Learning Android
4 stars 1 forks source link

Responsibility of StatusData and StatusData$DbHelper #2

Open timmy00274672 opened 10 years ago

timmy00274672 commented 10 years ago

StatusData$DbHelper

Now, I think that DbHelper is responsible for only database creation, version management, and upgrading.

StatusData

It's used to encapsulate the details for directly accessing the DbHelper and SQLiteDatabase. Therefore, we should not provide any method to get them.

(for version 4-4) Now, method StatusData#getDbHelper is very bad. It's designed just for TimelineActivity#setupList()'s query.We can provide a method of query like SQLiteDatabase but not provide a method to get DbHelper or even SQLiteDatabase.