Exemplo n.º 1
0
 public void ProcessOrder(OrderInfo orderInfo)
 {
     _billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
     _logger.Log("Billing processed");
     _customer.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
     _logger.Log("Customer updated");
     _notifier.SendReceipt(orderInfo);
     _logger.Log("Receipt sent");
 }
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor billingProcessor = _BillingProcessorLocator.GetBillingProcessor();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            _Logger.Log("Billing processed");
            _Customer.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            _Logger.Log("Customer updated");
            _Notifier.SendReceipt(orderInfo);
            _Logger.Log("Receipt sent");
        }
Exemplo n.º 3
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _ProcessorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _ProcessorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _ProcessorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _ProcessorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");
        }
Exemplo n.º 4
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _processorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _processorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _processorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _processorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");


            // Named Instance
            _plugin.DoSomething();

            // Regular Usage
            //foreach (IPostOrderPlugin plugin in _Plugins)
            //{
            //    plugin.DoSomething();
            //}
        }