3 ms·
When in Doubt, Create an Interface
- russell 18y agoI am of a contrary opinion, because I am consulting on a project where all of this was done in spades. Abstract class, interface, concrete class, spring runtime injection, and occasionally a factory, all for a single concrete implementation of a class. I think all of this should be done iteratively. Do the concrete class. If it turns out you need multiple implementations or subclasses, then go ahead with all the complexity. Too much of "best practices" leads to overdesign and implementation and maintenance costs.