Interfaces (interface/abstract class) are not abstractions?

abstraction, design-patterns, interface

Solution

Programming to an interface instead of an implementation is more about using data abstraction and encapsulation.

When we say "interface" in terms of programming to an interface. That kind of interface means the external facing methods and properties of a class. It doesn't have to be a language level interface. (The keyword interface.)

You should be striving to make sure that your code is not dependent on the internal details of other classes.

Problem

Of late, I have been reading posts which talks about the supposed wrong notion that interfaces are abstractions. One such post is http://blog.ploeh.dk/2010/12/02/InterfacesAreNotAbstractions.aspx I am a bit confused. If I don't have interfaces (interface/abstract class), then how will I inject my dependencies and mock them? Also, I have heard people talk about not using interfaces which has just one implementor. Like this blog here - http://simpleprogrammer.com/2010/11/02/back-to-basics-what-is-an-interface/ Now all this, doesn't it violate the principle - Program to an interface and not implementation?

Original source

Related problems