Example #1
0
        static void Main(string[] args)
        {
            var color        = new Color("red");
            var engine       = new Engine("V6");
            var transmission = new Transmission("Manual transmission");
            var car          = CarConstructor.Construct(engine, color, transmission);

            Console.WriteLine(car.ToString());
            car = CarConstructor.Reconstruct(car, new Engine("V8"));
            Console.WriteLine(car.ToString());
        }
Example #2
0
        static void Main(string[] args)
        {
            var color        = Color.Black;
            var engine       = Engine.AJ30;
            var transmission = Transmission.AS66RC;
            var car          = CarConstructor.Construct(engine, color, transmission);

            Console.WriteLine(car.ToString());
            car = CarConstructor.Reconstruct(car, Engine.E32);
            Console.WriteLine(car.ToString());
        }