static void Main(string[] args) { MachineFactory <ILogService> logservice = new MachineFactory <ILogService>(); var logDbService = logservice.CreateInstance("logdbservice"); logDbService.Save(); Console.Read(); }
private static void Main(string[] args) { string description = args[0]; IMachine machine = new MachineFactory().CreateInstance(description); machine.TurnOn(); machine.TurnOff(); Console.ReadKey(); }