4 ms·
public interfaces help to make dependencies clear and honest. If the implementation doesn't provide more methods than the interface (a transparent class in GoF
by _old_dude_ 8y ago
public interfaces help to make dependencies clear and honest.
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.
- 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.