@Elisedlund suggested to change the API entry point from StringToTypeParser to something else. Since library is called type-parser it feels more intuitive to call the entry point TypeParser.
However, the problem with that is: There already is an interface called TypeParser... so what to do?
There are a few suggestions:
- Prefix the interface with "I" as in
ITypeParser and rename StringToTypeParser to TypeParser
- Rename
TypeParser interface to TypeParserHandler and rename StringToTypeParser to TypeParser.
- Rename
StringToTypeParserBuilder to TypeParserBuilder.
- Rename
StringToTypeParserBuilder to TypeParserFactory.
- Rename
StringToTypeParser to TypeParser and rename TypeParser to StringToTypeParser.
Any other suggestions?
I'm leaning towards the last one, with the motivation that the API entry is the actual usage (and visible in code), while the TypeParser interface will not be used at all by some (i.e. default TypeParser are enough). I.e. keep the most used as short/simple as possible.
Usage example:
TypeParser parser = TypeParser.newBuilder()
.setsplitStrategy(SplitStrategy)
.registerTypeParser(StringToTypeParser)
.setInputPreprocessor(InputPreprocessor)
.build()
@Elisedlund suggested to change the API entry point from
StringToTypeParserto something else. Since library is called type-parser it feels more intuitive to call the entry point TypeParser.However, the problem with that is: There already is an interface called TypeParser... so what to do?
There are a few suggestions:
ITypeParserand renameStringToTypeParsertoTypeParserTypeParserinterface toTypeParserHandlerand renameStringToTypeParsertoTypeParser.StringToTypeParserBuildertoTypeParserBuilder.StringToTypeParserBuildertoTypeParserFactory.StringToTypeParsertoTypeParserand renameTypeParsertoStringToTypeParser.Any other suggestions?
I'm leaning towards the last one, with the motivation that the API entry is the actual usage (and visible in code), while the TypeParser interface will not be used at all by some (i.e. default TypeParser are enough). I.e. keep the most used as short/simple as possible.
Usage example: