コード例 #1
0
        static void Main(string[] args)
        {
            FurnitureAbstractFactory factory = FurnitureFactory.getFactory(MaterialType.FLASTIC);

            IChair chair = factory.createChair();

            chair.create(); // Create plastic chair

            ITable table = factory.createTable();

            table.create(); // Create plastic table
        }
コード例 #2
0
        static void Main(string[] args)
        {
            FuritureAbstractFactory factory = FurnitureFactory.GetFactory(MaterialType.Plastic);

            IChair chair = factory.CreateChair();

            chair.Create(); // create a plastic chair

            ITable table = factory.CreateTable();

            table.Create(); // create a plastic table
        }