Clarify the relation between SQLiteContentProviderImpl and ExtendedSQLiteOpenHelper #67
Conversation
Can one of the admins review this PR? |
CI, please test this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is basically moving the casting to another method that can be easily overridden.
And it forces sub classes to also use the ExtendedSQLiteOpenHelper. |
I agree with @juankysoriano
we don't want to force this do we? Rather we should get rid of the explicit cast and code that class to the interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this does not fix it, but helps users to understand the implementation better until #57 is fixed.
Yeah, I think this is better than stating this fixes the issue. And also better that having the current side-effect.
The ideal solution to #57 will then be something along the lines of what @blundell suggests.
Leaving this to @blundell in case he has more comments, thanks for the contribution @friedger
If we merged this solution it would couple us tighter to the current implementation. Right now it is an implicit cast that the public API doesn't know about. Merging this change would make the contract explicit but it would also mean a non backwards compatible change i.e. compile errors when people upgrade - then if we did the fix for #57 we would change the signatures back and people would again have a break in the API contract. I don't think we should merge this change. Sorry 👍 |
This PR clarifies the need of SQLiteContentProviderImpl for an ExtendedSQLiteOpenHelper.
getDatabaseHelper is overwritten and returns the ExtendedSQLiteOpenHelper.