Created
April 24, 2014 01:25
-
-
Save kshyju/11238354 to your computer and use it in GitHub Desktop.
generics with interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KPIDataProcessor<T> : IDataProcessor<T> | |
{ | |
public IEnumerable<T> Dtos { set; get; } | |
public void ProcessData() | |
{ | |
Console.WriteLine("Processing KPI data"); | |
} | |
} | |
public interface IDataProcessor<T> | |
{ | |
IEnumerable<T> Dtos { set; get; } | |
void ProcessData(); | |
} | |
public interface IDataLoader<T> | |
{ | |
IDataProcessor<T> Processor { get; } | |
void CheckForFiles(); | |
} | |
public class KPIDataLoader<T> : IDataLoader<T> | |
{ | |
public IDataProcessor<T> Processor | |
{ | |
get { return new KPIDataProcessor<string>(); } | |
} | |
public void CheckForFiles() | |
{ | |
Console.WriteLine("Checking for KPI specific file and parsing to DTOS"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment