Beispiel #1
0
        public void Resolve(IRequest request)
        {
            Console.WriteLine("Factory: Car Production Line Problem");
            IWheelFactory          wheelFactory   = new WheelFactory();
            IEngineFactory         engineFactory  = new EngineFactory();
            ILanternFactory        lanternFactory = new LanternFactory();
            ICarFactory            carFactory     = new CarFactory(wheelFactory, engineFactory, lanternFactory);
            ICollection <IProduct> cars           = carFactory.CreateProducts();

            foreach (IProduct car in cars)
            {
                Console.WriteLine(car.ProductId.Id);
            }
        }