I was going through the following link to understand what high-level and low-level modules mean in the context of Dependency Inversion Principle.
As per the explanation given there, is the following code snippet a good/appropriate example?
public class HighLevel
{
private IAbstraction _abstraction;
public HighLevel(IAbstraction abstraction)
{
_abstraction = abstraction;
}
public void Act()
{
_abstraction.DoSomething();
}
}
public interface IAbstraction
{
void DoSomething();
}
public class LowLevel: IAbstraction
{
public void DoSomething()
{
//Do something
}
}