Example #1
0
        public static ISweepstakeManager CreateManager()
        {
            ISweepstakeManager user  = null;
            string             input = Userinterface.PickAManager();

            switch (input)
            {
            case "Stack":
                user = new SweepstakeStackManager();
                break;

            case "Queue":
                user = new SweepstakesQueueManager();
                break;

            default:
                Console.WriteLine("Not a valid entry");
                CreateManager();
                break;
            }
            return(user);
        }
Example #2
0
 static void Main(string[] args)
 {
     ISweepstakeManager manager       = SweepstakeManagerFactory.CreateManager();
     MarketingFirm      marketingFirm = new MarketingFirm(manager);
 }
 public MarketingFirm(ISweepstakeManager manager)
 {
     this.manager = manager;
 }