My class derived from SQLiteOpenHelper is getting huge

后端 未结 5 1255
遥遥无期
遥遥无期 2021-02-19 07:55

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

5条回答
  •  没有蜡笔的小新
    2021-02-19 08:36

    Your helper should not need to be that size. I can only assume you are putting all code that manipulates data into your Helper.

    You should put code in the class to which it relates and where you can access it in an object oriented way.

    e.g If you have a Contacts class. You would put code that saved a contact to the database in it.

    See my post here

提交回复
热议问题