2 ms·
This is a good technique for libraries. Decoupling interface and implementation makes flexibility the default. If components only speak an interface to each o
by jrockway 17y ago
This is a good technique for libraries. Decoupling interface and implementation makes flexibility the default. If components only speak an interface to each other, it is easy to substitute them in the future.
The problem with Java is that the interfaces are usually useless. Imagine you have a build backend talking to a stoplight (red/green widget). The logical interface is for the builder to emit success or failure, and for the stoplight to internally change that to red or green. But of course, many people decide that the build backend should emit red or green, and that the stoplight widget should display that color. So while the build backend isn't coupled to an implementation in theory ("it just uses the RedOrGreenShowable interface!"), it actually is.
Programmers....