Using service loaders
Although we progressed through to a working, modularized solution for our string matchers during the last article, we still have an unwanted dependency that goes directly from module matchers.cli
to matchers.impl
. This prohibits us from using a clean and extensible way of injecting implementations of the Matcher
interface. Working through this article, our goal is to end up with a very loose coupling between our Java modules by implementing a mechanism for that kind of dependency injection.