private void btnStoreTrades_Click(object sender, EventArgs e)
        {
            ITradeStorage tradeStorage = new AdoNetTradeStorage(logger);

            tradeProcessor.StoreTrades(tradeStorage);
            txtStoreStatus.Text = "Trades written to database.";
        }
        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 StreamTradeDataProvider(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)
        {
            //var tradeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SingleResponsibilityPrinciple.trades.txt");
            string url            = "http://faculty.css.edu/tgibbons/trades4.txt";
            var    logger         = new ConsoleLogger();
            var    tradeValidator = new SimpleTradeValidator(logger);
            //var tradeDataProvider = new StreamTradeDataProvider(tradeStream);
            var urltradedata   = new URLTradeDataProvider(url);
            var tradeMapper    = new SimpleTradeMapper();
            var tradeParser    = new SimpleTradeParser(tradeValidator, tradeMapper);
            var tradeStorage   = new AdoNetTradeStorage(logger);
            var tradeProcessor = new TradeProcessor(urltradedata, tradeParser, tradeStorage);

            tradeProcessor.ProcessTrades();

            Console.ReadKey();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            using (var tradeStream = File.OpenRead("trades.txt"))
            {
                var logger            = new ConsoleLogger();
                var tradeValidator    = new SimpleTradeValidator(logger);
                var tradeDataProvider = new StreamTradeDataProvider(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)
        {
            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();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            var    tradeStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SingleResponsibilityPrinciple.trades.txt");
            String tradeUrl    = "http://faculty.css.edu/tgibbons/trades100.txt";

            var logger = new ConsoleLogger();
            //var logger = new GuiLogger(lbStatus.Items);

            //var tradeDataProvider = new StreamTradeDataProvider(tradeStream);
            var tradeDataProvider = new AdjustTradeDataProvider(tradeUrl); //changed to AdjustTradeDataProvider

            var tradeValidator = new SimpleTradeValidator(logger);
            var tradeMapper    = new SimpleTradeMapper();
            var tradeParser    = new SimpleTradeParser(tradeValidator, tradeMapper);

            var tradeStorage = new AdoNetTradeStorage(logger);

            tradeProcessor = new TradeProcessor(tradeDataProvider, tradeParser, tradeStorage);
        }
Ejemplo n.º 7
0
        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(IURLTradeDataProvider uRLTradeDataProvider, ITradeDataProvider tradeDataProvider, ITradeParser tradeParser, AdoNetTradeStorage tradeStorage)
 {
     this.uRLTradeDataProvider = uRLTradeDataProvider;
     this.tradeDataProvider    = tradeDataProvider;
     this.tradeParser          = tradeParser;
     this.tradeStorage         = tradeStorage;
 }
Ejemplo n.º 9
0
 public AsynchTradeStorage(ILogger logger)
 {
     this.logger  = logger;
     tradeStorage = new AdoNetTradeStorage(logger);
 }