I have a data set that can be created in several ways, one of them by parsing some text, the other way from CSV format, the third way by importing from the database.
This is currently the interface:
public interface IMyDataMaker
{
public MyDataSet MakeData();
}
and this is the text parser class:
public class MyDataSetTextParser : IMyDataMaker
{
private readonly string textToParse;
public MyDataSetTextParser(string text)
{
textToParse = text;
}
public MyDataSet MakeDate()
{
}
}
parser csv is closer to a text parser, this is a database class:
public class DbMyDataSetMaker : IMyDataMaker
{
private readonly SqlConnection connection;
public DbMyDataSetMaker(SqlConnection sqlConn)
{
connection = sqlConn;
}
public MyDataSet MakeDate()
{
}
}
Is this template used correctly in this case?
source
share