示例#1
0
        static void Main(string[] args)
        {
            //abstract factory design pattern
            TestAbstractFactory tbf = new TestAbstractFactory();

            tbf.Run();

            //factory method design pattern
            TestFactoryMethod tfm = new TestFactoryMethod();

            tfm.Run();

            //Singleton design pattern
            TestSingleton ts = new TestSingleton();

            ts.Run();

            TestOptimizedSingleton tos = new TestOptimizedSingleton();

            tos.Run();

            //Bridge design pattern
            TestBridge tb = new TestBridge();

            tb.Run();
        }
示例#2
0
 private void button16_Click(object sender, EventArgs e)
 {
     TestFactoryMethod.Testar();
 }