Are Explicit Interfaces Code Smell?

I’ve read tons of Stack Overflow Posts about this, but all the questions get marked as duplicate… but I still haven’t found what I’m looking for.

I thought interfaces were supposed to define behavior, and not implementation details. Explicit interfaces imply that interfaces also depend on implementation specifics. The inclusion of explicit interfaces in C# seems contrary to the philosophy behind the role of base classes and abstract classes. Interfaces define an API, and behavior implementations are determined by classes.

So in practice Explicit interfaces may be useful, and I’ve seen a few examples on stack overflow… But are they considered code smell? Ideally I’d imagine any specific implementation would be defined by a parent class, not an interface, or am I misguided?

submitted by /u/lazy_stacey
[link] [comments]

Leave a Reply