SQLiteQueryBuilder icon indicating copy to clipboard operation
SQLiteQueryBuilder copied to clipboard

Use package-private scope

Open monxalo opened this issue 10 years ago • 3 comments

We should consider changing some classes scope from public to package private. This avoids exposing a lot of internal classes that aren't meant to be used outside of the API.

Some examples:

  • JoinType
  • StringUtils

The only troublesome part is that we need to move the tests accordingly to have access to the classes like .StringUtilsTest.java -> .utils.StringUtilsTest.java.

monxalo avatar Aug 15 '15 00:08 monxalo

We can move JoinType, StringUtils and other enum classes from api to builder package, and make them package private. This only leaves Builder and SQLiteQueryBuilder in the original place and remove utils package completely. No package change required for unit tests.

This is just my opinion. Let's see what @alexfu would say.

shadeven avatar Aug 15 '15 11:08 shadeven

Restructuring the test directory to match up isn't something I'm too worried about. @monxalo your suggestion works for me.

alexfu avatar Aug 19 '15 11:08 alexfu

After tinkering with this, i realized that for StringUtils at least, will be hard to make package-private since it's used mostly everywhere.

If we had everything in a single package it would be straightforward but then we sacrifice organization of the classes.

For now, here's what can be made package-private:

  • JoinType
  • Contructors in every Select...Builder class.

monxalo avatar Nov 05 '15 21:11 monxalo