static void Main(string[] args) { var tradeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SingleResponsibilityPrinciple.trades.txt"); var logger = new ConsoleLogger(); var tradeValidator = new SimpleTradeValidator(logger); var tradeDataProvider = new URLTradeDataProvider("http://faculty.css.edu/tgibbons/trades4.txt"); var tradeMapper = new SimpleTradeMapper(); var tradeParser = new SimpleTradeParser(tradeValidator, tradeMapper); var tradeStorage = new AdoNetTradeStorage(logger); var tradeProcessor = new TradeProcessor(tradeDataProvider, tradeParser, tradeStorage); tradeProcessor.ProcessTrades(); Console.ReadKey(); }
static void Main(string[] args) { var tradeStream = "http://faculty.css.edu/tgibbons/trades4.txt"; var logger = new ConsoleLogger(); var tradeValidator = new SimpleTradeValidator(logger); var tradeDataProvider = new URLTradeDataProvider(tradeStream); var tradeMapper = new SimpleTradeMapper(); var tradeParser = new SimpleTradeParser(tradeValidator, tradeMapper); var tradeStorage = new AdoNetTradeStorage(logger); var tradeProcessor = new TradeProcessor(tradeDataProvider, tradeParser, tradeStorage); tradeProcessor.ProcessTrades(); Console.ReadKey(); }
static void Main(string[] args) { // Updated URLTradeDataProvider object instead of a StreamTradeDataProvider and pass the new data provider to the TradeProcessor var tradeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SingleResponsibilityPrinciple.trades.txt"); string urlData = "http://faculty.css.edu/tgibbons/trades4.txt"; var logger = new ConsoleLogger(); var tradeValidator = new SimpleTradeValidator(logger); var tradeURLProvider = new URLTradeDataProvider(urlData); var tradeMapper = new SimpleTradeMapper(); var tradeParser = new SimpleTradeParser(tradeValidator, tradeMapper); var tradeStorage = new AdoNetTradeStorage(logger); var tradeProcessor = new TradeProcessor(tradeURLProvider, tradeParser, tradeStorage); tradeProcessor.ProcessTrades(); Console.ReadKey(); }
public TradeProcessor(URLTradeDataProvider uRLTradeDataProvider, SimpleTradeParser tradeParser, AdoNetTradeStorage tradeStorage) { this.uRLTradeDataProvider = uRLTradeDataProvider; this.tradeParser = tradeParser; this.tradeStorage = tradeStorage; }