I am trying to create a textsearcher
library in java, that will have an interface TextSearcher
and 3 classes implementing it: RegexPatternSearcher
, SingleTokenSearcher
and MultiTokenSearcher
I then created a TextSearcherFacade
class that exposes static
methods like:
static findEmailAddresses(String input)
- usesRegexPatternSearcher
static findPhoneNumbers(String input)
- usesRegexPatternSearcher
static findDisallowedWords(String input, Set<String> disAllowedWords)
- usesSingleTokenSearcher
I want users of the library to have these (i.e. methods from TextSearcherFacade
) simple methods exposed for ease of use.
However, I don't like the idea of a single TextSearcherFacade
class with methods that configure and create the RegexPatternSearcher
, SingleTokenSearcher
and MultiTokenSearcher
because these methods depend on different classes and seem logically different.
I am trying to look for a better and more extensible way to design this library. Any help is greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire