3 ms·
> public interfaces help to make dependencies clear and honest. Again, moot point if there's only one implementation. > If the implementation doesn't provide
by hocuspocus 8y ago
> public interfaces help to make dependencies clear and honest.
Again, moot point if there's only one implementation.
> If the implementation doesn't provide more methods than the interface (a transparent class in GoF terminology) you should not name it.
> In Java, the implementation is usually created inside a static method (a static factory) of the interface as a lambda or an anonymous class.
And how's that not needlessly convoluted and ugly? You're illustrating guitarbill's point about applying design patterns blindly.