I thought exactly about this and didn't understand why we need ServiceLocatorPattern. There is also a third approach, called Strategy Pattern: just inject a list with Parsers List<Parser> parsers, define a method boolean match(ContentType) (acts as Predicate) on Parser interface and make sure every Parser implements it. The concrete Parser can be resolved as parser = parsers.stream().filter(parser -> parser.match(contentType)).findFirst().orElse(null). Sure, the approach with the Map is the best one because you don't need to iterrate over Parser impl.