Esempio n. 1
0
        public static void Main(string[] args)
        {
            ToyCreator creator = null;

            // create a firetruck
            Console.WriteLine("Creating a firetruck toy:");
            creator = new FiretruckCreator();
            creator.MakeToy();
            Console.WriteLine();

            // create a superman
            Console.WriteLine("Creating a superman toy:");
            creator = new SupermanCreator();
            creator.MakeToy();
            Console.WriteLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            ToyCreator creator = null;

            Console.WriteLine("Creating a fireTruck");
            creator = new FireTruckCreator();
            creator.MakeToy();
            Console.WriteLine();

            Console.WriteLine("Creating a Superman");
            creator = new SuperManCreator();
            creator.MakeToy();
            Console.WriteLine();

            Console.WriteLine("Creating a Duck");
            creator = new DuckCreator();
            creator.MakeToy();
            Console.WriteLine();
        }