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); }
static void Main(string[] args) { ISweepstakeManager manager = SweepstakeManagerFactory.CreateManager(); MarketingFirm marketingFirm = new MarketingFirm(manager); }
public MarketingFirm(ISweepstakeManager manager) { this.manager = manager; }