Beispiel #1
0
        static void Main(string[] args)
        {
            var truck = new TruckFactory();
            var ship  = new ShipFactory();

            truck.Deliver();
            ship.Deliver();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            TransportFactory currentFactory;
            Transport        currentTransport;

            currentFactory   = new TruckFactory();
            currentTransport = currentFactory.CreateTransport();
            currentTransport.Deliver();

            currentFactory   = new ShipFactory();
            currentTransport = currentFactory.CreateTransport();
            currentTransport.Deliver();

            currentFactory   = new PlaneFactory();
            currentTransport = currentFactory.CreateTransport();
            currentTransport.Deliver();
        }