I often see the code like this:
public abstract class AbstractDataReader
{
public void Read()
{
var reader = new StreamReader(FileName);
........
}
protected abstract string FileName
{
get;
}
}
public class DataReader : AbstractDataReader
{
protected override string FileName
{
get { return "data.txt"; }
}
}
As for me it seams as anti-pattern, as DataReader class has no logic, I can't use AbstractDataReader
without inheriting from it, it's also weird that I have to inherit the class just to specify parameter and also I works slower then just putting that parameters through the constructor.
But I can't find the name of this anti-pattern.
Does anybody know it?