我有几个使用以下接口类型的具体内容:
interface IActivity<T>
{
bool Process(T inputInfo);
}
具体类如下所示。
class ReportActivityManager :IActivity<DataTable>
{
public bool Process(DataTable inputInfo)
{
// Some coding here
}
}
class AnalyzerActivityManager :IActivity<string[]>
{
public bool Process(string[] inputInfo)
{
// Some coding here
}
}
现在我应该如何编写工厂类以返回一个通用接口,例如IActivity?
class Factory
{
public IActivity<T> Get(string module)
{
// ... How can i code here
}
}
谢谢