I've read that you should pass in an interface instead of a concrete implementation so that the consumer doesn't need to know anything about implementation details.
I don't understand how injecting a concrete class exposes implementation details?
class ServiceA() {
private something
public method1(){
res = doSomething(this.something)
res = doSomethingElse()
return res;
}
}
interface Service {
method1(): something
}
How does injecting ServiceA expose anything about the implementation? The consumer would still only have access to method1 right?