Пример #1
0
        static void Main(string[] args)
        {
            ManagerCreator manager       = new ManagerCreator();
            MarketingFirm  marketingFirm = new MarketingFirm(manager.MakeAManager(UserInterface.ChooseManager()));

            marketingFirm.Start();
        }
Пример #2
0
        //Method Injection is applied on this method
        public void Marketingfirm(ISweepstakesManager manager)
        {
            //Factory Pattern will be applied here to have the option on which manager type will used
            //this.manager = manager;

            string managerType = UserInterface.ChooseManager();

            if (managerType == "Stack")
            {
                manager = new SweepstakesStackManager();
            }
            else if (managerType == "Queue")
            {
                manager = new SweepstakesQueueManager();
            }
            else
            {
                return;
            }
        }   //Method Injection is applied on this method