Esempio n. 1
0
        static void Main(string[] args)
        {
            VehicleManager manager = new VehicleManager();
            IVehicle       saloon1 = manager.CreateSaloon();
            IVehicle       saloon2 = manager.CreateSaloon();
            IVehicle       pickup1 = manager.CreatePickup();

            Console.WriteLine(saloon1);
            Console.WriteLine(saloon2);
            Console.WriteLine(pickup1);

            Console.WriteLine();
            Console.WriteLine("Lazy...");
            Console.WriteLine();

            VehicleManagerLazy managerlazy = new VehicleManagerLazy();
            IVehicle           saloon11    = manager.CreateSaloon();
            IVehicle           saloon22    = manager.CreateSaloon();
            IVehicle           pickup11    = manager.CreatePickup();

            Console.WriteLine(saloon11);
            Console.WriteLine(saloon22);
            Console.WriteLine(pickup11);

            Console.Read();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            VehicleManagerLazy vehiclemanagerlazy = new VehicleManagerLazy();

            IVehicle saloon1 = vehiclemanagerlazy.CreateSaloon();
            IVehicle saloon2 = vehiclemanagerlazy.CreateSaloon();
            IVehicle pickup1 = vehiclemanagerlazy.CreatePickUp();
        }