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

            truck.Deliver();
            ship.Deliver();
        }
예제 #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();
        }