DEV Community

Discussion on: Interfaces are overrated

Collapse
 
jennrmillerdev profile image
Jen Miller

I think you are correct in that when you only have one implementation of a interface, then perhaps that interface isn't required. I have seen situations where that's the case. Ex The developer made interfaces for each concrete service class. In my opinion, this just adds more clutter.

I get the problem you are saying too and experienced that issue as well. If you absolutely know a particular instance will always be a certain concrete class, then declaring the variable as the concrete class is more meaningful.

Like you said, there are good reasons for interfaces. Interfaces are just another tool in your arsenal to write good code and enforce certain standards across the team.