static void Main(string[] args)
        {
            var    tradeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SingleResponsibilityPrinciple.trades.txt");
            String tradeUrl    = "http://faculty.css.edu/tgibbons/trades4.txt";

            var logger = new ConsoleLogger();

            //var tradeDataProvider = new StreamTradeDataProvider(tradeStream);
            var tradeDataProvider = new UrlTradeDataProvider(tradeUrl);
            var SynchTradeStorage = new AdoNetTradeStorage(logger);
            var tradeValidator    = new SimpleTradeValidator(logger);
            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();
        }
示例#2
0
 public AsynchUrlTradeDataProvider(String url, TradeDataUpdate newTradeUpdater)
 {
     SynchTradeProvider = new UrlTradeDataProvider(url);
     this.url           = url;
     tradeUpdater       = newTradeUpdater;
 }
示例#3
0
 /// <summary>
 /// Create UrlTradeDataProvider
 /// </summary>
 /// <param name="url">url of trade data</param>
 public AdjustTradeDataProvider(String url)
 {
     urlTradeDataProvider = new UrlTradeDataProvider(url);
 }