My class derived from SQLiteOpenHelper
is getting bigger and bigger over a time. At the speaking time it is more than 1500 lines of code which is not considered to
You may consider a singleton class to only open and close db connection (or catch, release like a pool) then executing the db operations with command class like in command pattern
And you can use facade pattern to merge this commands in an execute order for more complex database operations.This will make your code clean and easy to control. like when you change your InsertBookCommand
class, all related operations will change behavior due to it.
To sum up, my solution is:
Open db connection and pass the db as parameter to commands. then execute the commands.