2 ms·
There is a large difference between dogmatically declaring that every single service needs an interface, versus just introducing them at the point where you act
by KronisLV 5y ago
There is a large difference between dogmatically declaring that every single service needs an interface, versus just introducing them at the point where you actually need more than one implementation.
I think that's the author's original argument - not that interfaces are bad in of themselves, but that cargo culting is problematic.
Furthermore, starting with an interface oftentimes makes you create the wrong abstraction, however when you have a concrete implementation, in my experience extracting an interface becomes easier to do, though mostly thanks to excellent IDE tooling.
- floverfelt 5y agoExactly, it would've made total sense to pull it out into an interface in other situations, but simply felt like a preference here.