Skip to content

Rename API entry point #10

@drapostolos

Description

@drapostolos

@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()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions