If you’ve worked with me or followed me for a while it probably shouldn’t surprise you that I agree with Hadi’s tweet below 👇🏻 …
“I’m declaring an interface because one day I may have multiple implementations”
— Hadi Hariri (@hhariri) May 10, 2022
Sure. So when that day comes, do an Extract Interface refactoring. Most IDEs do it for you in a single click. Until then, drop the interface.
My approach is always to only create interfaces IF and WHEN they are needed and to avoid doing too much upfront ‘just in case’ design.
A lot of developers fail to realize that even though interfaces are very simple to create initially, using them is not a ‘one-time cost’. Interfaces add architectural complexity and have a real ongoing cost so by all means add them when needed but not before…